| 1 | from json.tests import PyTest, CTest |
| 2 | |
| 3 | |
| 4 | # from http://json.org/JSON_checker/test/pass3.json |
| 5 | JSON = r''' |
| 6 | { |
| 7 | "JSON Test Pattern pass3": { |
| 8 | "The outermost value": "must be an object or array.", |
| 9 | "In this test": "It is an object." |
| 10 | } |
| 11 | } |
| 12 | ''' |
| 13 | |
| 14 | |
| 15 | class TestPass3(object): |
| 16 | def test_parse(self): |
| 17 | # test in/out equivalence and parsing |
| 18 | res = self.loads(JSON) |
| 19 | out = self.dumps(res) |
| 20 | self.assertEqual(res, self.loads(out)) |
| 21 | |
| 22 | |
| 23 | class TestPyPass3(TestPass3, PyTest): pass |
| 24 | class TestCPass3(TestPass3, CTest): pass |