]>
git.proxmox.com Git - mirror_edk2.git/blob - AppPkg/Applications/Python/Python-2.7.2/Lib/json/tests/test_pass1.py
1 from json
.tests
import PyTest
, CTest
4 # from http://json.org/JSON_checker/test/pass1.json
7 "JSON Test Pattern pass1",
8 {"object with 1 member":["array with 1 element"]},
16 "integer": 1234567890,
26 "controls": "\b\f\n\r\t",
28 "alpha": "abcdefghijklmnopqrstuvwyz",
29 "ALPHA": "ABCDEFGHIJKLMNOPQRSTUVWYZ",
30 "digit": "0123456789",
31 "special": "`1~!@#$%^&*()_+-={':[,]}|;.</>?",
32 "hex": "\u0123\u4567\u89AB\uCDEF\uabcd\uef4A",
38 "address": "50 St. James Street",
39 "url": "http://www.JSON.org/",
40 "comment": "// /* <!-- --",
42 " s p a c e d " :[1,2 , 3
47 "compact": [1,2,3,4,5,6,7],
48 "jsontext": "{\"object with 1 member\":[\"array with 1 element\"]}",
49 "quotes": "" \u0022 %22 0x22 034 "",
50 "\/\\\"\uCAFE\uBABE\uAB98\uFCDE\ubcda\uef4A\b\f\n\r\t`1~!@#$%^&*()_+-=[]{}|;:',./<>?"
51 : "A key can be any string"
64 class TestPass1(object):
66 # test in/out equivalence and parsing
67 res
= self
.loads(JSON
)
69 self
.assertEqual(res
, self
.loads(out
))
71 self
.dumps(res
, allow_nan
=False)
75 self
.fail("23456789012E666 should be out of range")
78 class TestPyPass1(TestPass1
, PyTest
): pass
79 class TestCPass1(TestPass1
, CTest
): pass