Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(41)

Side by Side Diff: Lib/json/tests/test_indent.py

Issue 3232042: #9424: convert deprecated assert methods in the Python test suite Base URL: http://svn.python.org/projects/python/branches/py3k/
Patch Set: Minor cleanups Created 14 years, 2 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Lib/json/tests/test_float.py ('k') | Lib/json/tests/test_pass1.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 from unittest import TestCase 1 from unittest import TestCase
2 2
3 import json 3 import json
4 import textwrap 4 import textwrap
5 5
6 class TestIndent(TestCase): 6 class TestIndent(TestCase):
7 def test_indent(self): 7 def test_indent(self):
8 h = [['blorpie'], ['whoops'], [], 'd-shtaeou', 'd-nthiouh', 'i-vhbjkhnth ', 8 h = [['blorpie'], ['whoops'], [], 'd-shtaeou', 'd-nthiouh', 'i-vhbjkhnth ',
9 {'nifty': 87}, {'field': 'yes', 'morefield': False} ] 9 {'nifty': 87}, {'field': 'yes', 'morefield': False} ]
10 10
(...skipping 20 matching lines...) Expand all
31 31
32 32
33 d1 = json.dumps(h) 33 d1 = json.dumps(h)
34 d2 = json.dumps(h, indent=2, sort_keys=True, separators=(',', ': ')) 34 d2 = json.dumps(h, indent=2, sort_keys=True, separators=(',', ': '))
35 d3 = json.dumps(h, indent='\t', sort_keys=True, separators=(',', ': ')) 35 d3 = json.dumps(h, indent='\t', sort_keys=True, separators=(',', ': '))
36 36
37 h1 = json.loads(d1) 37 h1 = json.loads(d1)
38 h2 = json.loads(d2) 38 h2 = json.loads(d2)
39 h3 = json.loads(d3) 39 h3 = json.loads(d3)
40 40
41 self.assertEquals(h1, h) 41 self.assertEqual(h1, h)
42 self.assertEquals(h2, h) 42 self.assertEqual(h2, h)
43 self.assertEquals(h3, h) 43 self.assertEqual(h3, h)
44 self.assertEquals(d2, expect.expandtabs(2)) 44 self.assertEqual(d2, expect.expandtabs(2))
45 self.assertEquals(d3, expect) 45 self.assertEqual(d3, expect)
OLDNEW
« no previous file with comments | « Lib/json/tests/test_float.py ('k') | Lib/json/tests/test_pass1.py » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b