+++ /dev/null
-import textwrap\r
-from json.tests import PyTest, CTest\r
-\r
-\r
-class TestSeparators(object):\r
- def test_separators(self):\r
- h = [['blorpie'], ['whoops'], [], 'd-shtaeou', 'd-nthiouh', 'i-vhbjkhnth',\r
- {'nifty': 87}, {'field': 'yes', 'morefield': False} ]\r
-\r
- expect = textwrap.dedent("""\\r
- [\r
- [\r
- "blorpie"\r
- ] ,\r
- [\r
- "whoops"\r
- ] ,\r
- [] ,\r
- "d-shtaeou" ,\r
- "d-nthiouh" ,\r
- "i-vhbjkhnth" ,\r
- {\r
- "nifty" : 87\r
- } ,\r
- {\r
- "field" : "yes" ,\r
- "morefield" : false\r
- }\r
- ]""")\r
-\r
-\r
- d1 = self.dumps(h)\r
- d2 = self.dumps(h, indent=2, sort_keys=True, separators=(' ,', ' : '))\r
-\r
- h1 = self.loads(d1)\r
- h2 = self.loads(d2)\r
-\r
- self.assertEqual(h1, h)\r
- self.assertEqual(h2, h)\r
- self.assertEqual(d2, expect)\r
-\r
-\r
-class TestPySeparators(TestSeparators, PyTest): pass\r
-class TestCSeparators(TestSeparators, CTest): pass\r