diff options
Diffstat (limited to 'Lib/json/tests/test_dump.py')
-rw-r--r-- | Lib/json/tests/test_dump.py | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/Lib/json/tests/test_dump.py b/Lib/json/tests/test_dump.py index 8df234b..6f5262b 100644 --- a/Lib/json/tests/test_dump.py +++ b/Lib/json/tests/test_dump.py @@ -1,21 +1,24 @@ -from unittest import TestCase from io import StringIO +from json.tests import PyTest, CTest -import json -class TestDump(TestCase): +class TestDump: def test_dump(self): sio = StringIO() - json.dump({}, sio) + self.json.dump({}, sio) self.assertEqual(sio.getvalue(), '{}') def test_dumps(self): - self.assertEqual(json.dumps({}), '{}') + self.assertEqual(self.dumps({}), '{}') def test_encode_truefalse(self): - self.assertEqual(json.dumps( + self.assertEqual(self.dumps( {True: False, False: True}, sort_keys=True), '{"false": true, "true": false}') - self.assertEqual(json.dumps( + self.assertEqual(self.dumps( {2: 3.0, 4.0: 5, False: 1, 6: True}, sort_keys=True), '{"false": 1, "2": 3.0, "4.0": 5, "6": true}') + + +class TestPyDump(TestDump, PyTest): pass +class TestCDump(TestDump, CTest): pass |