summaryrefslogtreecommitdiffstats
path: root/Lib/json/tests/test_dump.py
blob: d288c0d293f89ae048d5c9fc28d1c98a9180bbb8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
from unittest import TestCase
from cStringIO import StringIO

import json

class TestDump(TestCase):
    def test_dump(self):
        sio = StringIO()
        json.dump({}, sio)
        self.assertEquals(sio.getvalue(), '{}')

    def test_dumps(self):
        self.assertEquals(json.dumps({}), '{}')