]>
git.proxmox.com Git - mirror_edk2.git/blob - AppPkg/Applications/Python/Python-2.7.2/Lib/json/tests/test_dump.py
755096b2a361458e472f928116274b54cc39d6f1
1 from cStringIO
import StringIO
2 from json
.tests
import PyTest
, CTest
5 class TestDump(object):
8 self
.json
.dump({}, sio
)
9 self
.assertEqual(sio
.getvalue(), '{}')
12 self
.assertEqual(self
.dumps({}), '{}')
14 def test_encode_truefalse(self
):
15 self
.assertEqual(self
.dumps(
16 {True: False, False: True}, sort_keys
=True),
17 '{"false": true, "true": false}')
18 self
.assertEqual(self
.dumps(
19 {2: 3.0, 4.0: 5L, False: 1, 6L: True}, sort_keys
=True),
20 '{"false": 1, "2": 3.0, "4.0": 5, "6": true}')
22 class TestPyDump(TestDump
, PyTest
): pass
23 class TestCDump(TestDump
, CTest
): pass