PageRenderTime 323ms CodeModel.GetById 181ms app.highlight 2ms RepoModel.GetById 139ms app.codeStats 0ms

/Lib/json/tests/test_dump.py

http://unladen-swallow.googlecode.com/
Python | 13 lines | 10 code | 3 blank | 0 comment | 0 complexity | bfd1d93474795ae776444156377ce299 MD5 | raw file
 1from unittest import TestCase
 2from cStringIO import StringIO
 3
 4import json
 5
 6class TestDump(TestCase):
 7    def test_dump(self):
 8        sio = StringIO()
 9        json.dump({}, sio)
10        self.assertEquals(sio.getvalue(), '{}')
11
12    def test_dumps(self):
13        self.assertEquals(json.dumps({}), '{}')