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