/Lib/json/tests/test_pass3.py

http://unladen-swallow.googlecode.com/ · Python · 20 lines · 15 code · 3 blank · 2 comment · 0 complexity · 918209f03eb24902bbaa45b634ef0de6 MD5 · raw file

  1. from unittest import TestCase
  2. import 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.assertEquals(res, json.loads(out))