Mercurial > cpython-lru_cache-weakref
annotate Lib/json/tests/test_pass2.py @ 79675:c0a2294de787 2.7
Issue #16199: Backport 2to3 typo fix from 3.2.
| author | Chris Jerdonek <chris.jerdonek@gmail.com> |
|---|---|
| date | Thu, 11 Oct 2012 16:15:46 -0700 |
| parents | 5b0fecd2eba0 |
| children |
| rev | line source |
|---|---|
|
70084
5b0fecd2eba0
#5723: Improve json tests to be executed with and without accelerations.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
66348
diff
changeset
|
1 from json.tests import PyTest, CTest |
|
5b0fecd2eba0
#5723: Improve json tests to be executed with and without accelerations.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
66348
diff
changeset
|
2 |
|
46676
4ded35754cb7
Add the 'json' package. Code taken from simplejson 1.9 and contributed by Bob
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
3 |
|
4ded35754cb7
Add the 'json' package. Code taken from simplejson 1.9 and contributed by Bob
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
4 # from http://json.org/JSON_checker/test/pass2.json |
|
4ded35754cb7
Add the 'json' package. Code taken from simplejson 1.9 and contributed by Bob
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
5 JSON = r''' |
|
4ded35754cb7
Add the 'json' package. Code taken from simplejson 1.9 and contributed by Bob
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
6 [[[[[[[[[[[[[[[[[[["Not too deep"]]]]]]]]]]]]]]]]]]] |
|
4ded35754cb7
Add the 'json' package. Code taken from simplejson 1.9 and contributed by Bob
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
7 ''' |
|
4ded35754cb7
Add the 'json' package. Code taken from simplejson 1.9 and contributed by Bob
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
8 |
|
70084
5b0fecd2eba0
#5723: Improve json tests to be executed with and without accelerations.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
66348
diff
changeset
|
9 class TestPass2(object): |
|
46676
4ded35754cb7
Add the 'json' package. Code taken from simplejson 1.9 and contributed by Bob
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
10 def test_parse(self): |
|
4ded35754cb7
Add the 'json' package. Code taken from simplejson 1.9 and contributed by Bob
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
11 # test in/out equivalence and parsing |
|
70084
5b0fecd2eba0
#5723: Improve json tests to be executed with and without accelerations.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
66348
diff
changeset
|
12 res = self.loads(JSON) |
|
5b0fecd2eba0
#5723: Improve json tests to be executed with and without accelerations.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
66348
diff
changeset
|
13 out = self.dumps(res) |
|
5b0fecd2eba0
#5723: Improve json tests to be executed with and without accelerations.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
66348
diff
changeset
|
14 self.assertEqual(res, self.loads(out)) |
|
5b0fecd2eba0
#5723: Improve json tests to be executed with and without accelerations.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
66348
diff
changeset
|
15 |
|
5b0fecd2eba0
#5723: Improve json tests to be executed with and without accelerations.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
66348
diff
changeset
|
16 |
|
5b0fecd2eba0
#5723: Improve json tests to be executed with and without accelerations.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
66348
diff
changeset
|
17 class TestPyPass2(TestPass2, PyTest): pass |
|
5b0fecd2eba0
#5723: Improve json tests to be executed with and without accelerations.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
66348
diff
changeset
|
18 class TestCPass2(TestPass2, CTest): pass |
