/Lib/json/tests/test_pass2.py

http://unladen-swallow.googlecode.com/ · Python · 14 lines · 10 code · 2 blank · 2 comment · 0 complexity · 8caf0a5f325985b32585d4dc450c8193 MD5 · raw file

  1. from unittest import TestCase
  2. import json
  3. # from http://json.org/JSON_checker/test/pass2.json
  4. JSON = r'''
  5. [[[[[[[[[[[[[[[[[[["Not too deep"]]]]]]]]]]]]]]]]]]]
  6. '''
  7. class TestPass2(TestCase):
  8. def test_parse(self):
  9. # test in/out equivalence and parsing
  10. res = json.loads(JSON)
  11. out = json.dumps(res)
  12. self.assertEquals(res, json.loads(out))