summaryrefslogtreecommitdiffstats
path: root/Lib/json/tests/test_dump.py
blob: 06a56d7cd97f48db17f22911dc241ebee589dea2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
from unittest import TestCase
from io 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({}), '{}')