From c78e5079d466b653ea09714b4159c77740e7d861 Mon Sep 17 00:00:00 2001 From: Stefan Wojcik Date: Sun, 4 Dec 2016 15:33:48 -0500 Subject: [PATCH] extra test for escaping quotes --- tests/test_datastructures.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test_datastructures.py b/tests/test_datastructures.py index 5fa62b14..eb40e767 100644 --- a/tests/test_datastructures.py +++ b/tests/test_datastructures.py @@ -18,6 +18,10 @@ class TestStrictDict(unittest.TestCase): d = self.dtype(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): self.assertRaises(AttributeError, lambda: self.dtype(a=1, b=2, d=3))