diff options
author | Bob Ippolito <bob@redivi.com> | 2009-12-27 08:00:44 +0000 |
---|---|---|
committer | Bob Ippolito <bob@redivi.com> | 2009-12-27 08:00:44 +0000 |
commit | 9a4048948610d9e310da88156e92ec226b3c30c1 (patch) | |
tree | 46f82b2f7b4c044d18aab85100c4a3305f6753f7 /simplejson/tests/test_dump.py | |
parent | a6997d204b61532b9d80941ab1dfc3484f689ef3 (diff) | |
download | simplejson-9a4048948610d9e310da88156e92ec226b3c30c1.tar.gz |
use iteritems instead of PyDict_Next (at the expense of some speed) http://bugs.python.org/issue6105
git-svn-id: http://simplejson.googlecode.com/svn/trunk@197 a4795897-2c25-0410-b006-0d3caba88fa1
Diffstat (limited to 'simplejson/tests/test_dump.py')
-rw-r--r-- | simplejson/tests/test_dump.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/simplejson/tests/test_dump.py b/simplejson/tests/test_dump.py index 4de37cf..8b34004 100644 --- a/simplejson/tests/test_dump.py +++ b/simplejson/tests/test_dump.py @@ -19,3 +19,9 @@ class TestDump(TestCase): 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}') + + def test_ordered_dict(self): + # http://bugs.python.org/issue6105 + items = [('one', 1), ('two', 2), ('three', 3), ('four', 4), ('five', 5)] + s = json.dumps(json.OrderedDict(items)) + self.assertEqual(s, '{"one": 1, "two": 2, "three": 3, "four": 4, "five": 5}')
\ No newline at end of file |