diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-05-02 12:36:44 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-05-02 12:36:44 (GMT) |
commit | c6b607d4a9e4d60fb506034ce67fc89734bb68a7 (patch) | |
tree | b4f27e81ab25a9dfe6a97433f4d25c263b59f6cc /Lib/json/tests/test_dump.py | |
parent | 7255f18556ae70fc28b563a345577d3ec8f6f0ba (diff) | |
download | cpython-c6b607d4a9e4d60fb506034ce67fc89734bb68a7.zip cpython-c6b607d4a9e4d60fb506034ce67fc89734bb68a7.tar.gz cpython-c6b607d4a9e4d60fb506034ce67fc89734bb68a7.tar.bz2 |
port simplejson upgrade from the trunk #4136
json also now works only with unicode strings
Patch by Antoine Pitrou; updated by me
Diffstat (limited to 'Lib/json/tests/test_dump.py')
-rw-r--r-- | Lib/json/tests/test_dump.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/json/tests/test_dump.py b/Lib/json/tests/test_dump.py index 06a56d7..54e218f 100644 --- a/Lib/json/tests/test_dump.py +++ b/Lib/json/tests/test_dump.py @@ -11,3 +11,11 @@ class TestDump(TestCase): def test_dumps(self): self.assertEquals(json.dumps({}), '{}') + + def test_encode_truefalse(self): + self.assertEquals(json.dumps( + {True: False, False: True}, sort_keys=True), + '{"false": true, "true": false}') + self.assertEquals(json.dumps( + {2: 3.0, 4.0: 5, False: 1, 6: True}, sort_keys=True), + '{"false": 1, "2": 3.0, "4.0": 5, "6": true}') |