PageRenderTime 195ms CodeModel.GetById 93ms app.highlight 2ms RepoModel.GetById 99ms app.codeStats 0ms

/Lib/json/tests/test_pass3.py

http://unladen-swallow.googlecode.com/
Python | 20 lines | 17 code | 2 blank | 1 comment | 0 complexity | 918209f03eb24902bbaa45b634ef0de6 MD5 | raw file
 1from unittest import TestCase
 2
 3import json
 4
 5# from http://json.org/JSON_checker/test/pass3.json
 6JSON = r'''
 7{
 8    "JSON Test Pattern pass3": {
 9        "The outermost value": "must be an object or array.",
10        "In this test": "It is an object."
11    }
12}
13'''
14
15class TestPass3(TestCase):
16    def test_parse(self):
17        # test in/out equivalence and parsing
18        res = json.loads(JSON)
19        out = json.dumps(res)
20        self.assertEquals(res, json.loads(out))