extra test for escaping quotes
This commit is contained in:
parent
ab69e50361
commit
c78e5079d4
@ -18,6 +18,10 @@ class TestStrictDict(unittest.TestCase):
|
|||||||
d = self.dtype(a=1, b=2, c=3)
|
d = self.dtype(a=1, b=2, c=3)
|
||||||
self.assertEqual(repr(d), '{"a": 1, "b": 2, "c": 3}')
|
self.assertEqual(repr(d), '{"a": 1, "b": 2, "c": 3}')
|
||||||
|
|
||||||
|
# make sure quotes are escaped properly
|
||||||
|
d = self.dtype(a='"', b="'", c="")
|
||||||
|
self.assertEqual(repr(d), '{"a": \'"\', "b": "\'", "c": \'\'}')
|
||||||
|
|
||||||
def test_init_fails_on_nonexisting_attrs(self):
|
def test_init_fails_on_nonexisting_attrs(self):
|
||||||
self.assertRaises(AttributeError, lambda: self.dtype(a=1, b=2, d=3))
|
self.assertRaises(AttributeError, lambda: self.dtype(a=1, b=2, d=3))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user