summaryrefslogtreecommitdiffstats
path: root/Lib/json/tests/test_dump.py
diff options
context:
space:
mode:
authorBob Ippolito <bob@redivi.com>2009-03-17 23:19:00 (GMT)
committerBob Ippolito <bob@redivi.com>2009-03-17 23:19:00 (GMT)
commitd914e3f8619df604ca6fa852fd210043b94f16e1 (patch)
tree99352cdd395da08a735041039f7f336a92485f8d /Lib/json/tests/test_dump.py
parent277859d5910782cc31bb27f2472893b8382ad391 (diff)
downloadcpython-d914e3f8619df604ca6fa852fd210043b94f16e1.zip
cpython-d914e3f8619df604ca6fa852fd210043b94f16e1.tar.gz
cpython-d914e3f8619df604ca6fa852fd210043b94f16e1.tar.bz2
merge json library with simplejson 2.0.9 (issue 4136)
Diffstat (limited to 'Lib/json/tests/test_dump.py')
-rw-r--r--Lib/json/tests/test_dump.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/json/tests/test_dump.py b/Lib/json/tests/test_dump.py
index d288c0d..9fa0ba8 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: 5L, False: 1, 6L: True, "7": 0}, sort_keys=True),
+ '{"false": 1, "2": 3.0, "4.0": 5, "6": true, "7": 0}')