test_pass3.py 482 B

1234567891011121314151617181920
  1. from unittest import TestCase
  2. import simplejson as json
  3. # from http://json.org/JSON_checker/test/pass3.json
  4. JSON = r'''
  5. {
  6. "JSON Test Pattern pass3": {
  7. "The outermost value": "must be an object or array.",
  8. "In this test": "It is an object."
  9. }
  10. }
  11. '''
  12. class TestPass3(TestCase):
  13. def test_parse(self):
  14. # test in/out equivalence and parsing
  15. res = json.loads(JSON)
  16. out = json.dumps(res)
  17. self.assertEqual(res, json.loads(out))