diff options
author | Bob Ippolito <bob@redivi.com> | 2009-02-16 00:48:35 +0000 |
---|---|---|
committer | Bob Ippolito <bob@redivi.com> | 2009-02-16 00:48:35 +0000 |
commit | edb409fab04d0a5ff18eeb8f0225c5bd79fc5a25 (patch) | |
tree | 3cec2c5e00f9e0103c3de6bee77709b6148ab86d /simplejson/tests/test_dump.py | |
parent | e36815997181e2d74c2180fb7fe7bb142631bae8 (diff) | |
download | simplejson-edb409fab04d0a5ff18eeb8f0225c5bd79fc5a25.tar.gz |
fixed http://code.google.com/p/simplejson/issues/detail?id=35 -- no longer checks exactly for True and False
git-svn-id: http://simplejson.googlecode.com/svn/trunk@164 a4795897-2c25-0410-b006-0d3caba88fa1
Diffstat (limited to 'simplejson/tests/test_dump.py')
-rw-r--r-- | simplejson/tests/test_dump.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/simplejson/tests/test_dump.py b/simplejson/tests/test_dump.py index 0f2a212..4de37cf 100644 --- a/simplejson/tests/test_dump.py +++ b/simplejson/tests/test_dump.py @@ -1,13 +1,21 @@ from unittest import TestCase from cStringIO import StringIO -import simplejson as S +import simplejson as json class TestDump(TestCase): def test_dump(self): sio = StringIO() - S.dump({}, sio) + json.dump({}, sio) self.assertEquals(sio.getvalue(), '{}') def test_dumps(self): - self.assertEquals(S.dumps({}), '{}') + 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}') |