File tree 2 files changed +6
-7
lines changed
Filter options
2 files changed +6
-7
lines changed
Original file line number Diff line number Diff line change @@ -27,11 +27,7 @@ def escape_item(val, charset, mapping=None):
27
27
28
28
29
29
def escape_dict (val , charset , mapping = None ):
30
- n = {}
31
- for k , v in val .items ():
32
- quoted = escape_item (v , charset , mapping )
33
- n [k ] = quoted
34
- return n
30
+ raise TypeError ("dict can not be used as parameter" )
35
31
36
32
37
33
def escape_sequence (val , charset , mapping = None ):
Original file line number Diff line number Diff line change @@ -848,12 +848,15 @@ def test_escape_no_default(self):
848
848
849
849
self .assertRaises (TypeError , con .escape , 42 , {})
850
850
851
- def test_escape_dict_value (self ):
851
+ def test_escape_dict_raise_typeerror (self ):
852
+ """con.escape(dict) should raise TypeError"""
852
853
con = self .connect ()
853
854
854
855
mapping = con .encoders .copy ()
855
856
mapping [Foo ] = escape_foo
856
- self .assertEqual (con .escape ({"foo" : Foo ()}, mapping ), {"foo" : "bar" })
857
+ #self.assertEqual(con.escape({"foo": Foo()}, mapping), {"foo": "bar"})
858
+ with self .assertRaises (TypeError ):
859
+ con .escape ({"foo" : Foo ()})
857
860
858
861
def test_escape_list_item (self ):
859
862
con = self .connect ()
You can’t perform that action at this time.
0 commit comments