summaryrefslogtreecommitdiffstats
path: root/Lib/test/json_tests/test_indent.py
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2012-11-28 22:42:56 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2012-11-28 22:42:56 (GMT)
commit100314427a558be01bb42f8bdb4bab800cd114d2 (patch)
tree5a520cf84a80823bfcec7c58aafe2457effed1cd /Lib/test/json_tests/test_indent.py
parentd966c2156ad0bba85258262e5535912361cbd7b7 (diff)
downloadcpython-100314427a558be01bb42f8bdb4bab800cd114d2.zip
cpython-100314427a558be01bb42f8bdb4bab800cd114d2.tar.gz
cpython-100314427a558be01bb42f8bdb4bab800cd114d2.tar.bz2
#16333: use (",", ": ") as default separator when indent is specified to avoid trailing whitespace. Patch by Serhiy Storchaka.
Diffstat (limited to 'Lib/test/json_tests/test_indent.py')
-rw-r--r--Lib/test/json_tests/test_indent.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/json_tests/test_indent.py b/Lib/test/json_tests/test_indent.py
index 4c70646..4eb4f89 100644
--- a/Lib/test/json_tests/test_indent.py
+++ b/Lib/test/json_tests/test_indent.py
@@ -32,6 +32,8 @@ class TestIndent:
d1 = self.dumps(h)
d2 = self.dumps(h, indent=2, sort_keys=True, separators=(',', ': '))
d3 = self.dumps(h, indent='\t', sort_keys=True, separators=(',', ': '))
+ d4 = self.dumps(h, indent=2, sort_keys=True)
+ d5 = self.dumps(h, indent='\t', sort_keys=True)
h1 = self.loads(d1)
h2 = self.loads(d2)
@@ -42,6 +44,8 @@ class TestIndent:
self.assertEqual(h3, h)
self.assertEqual(d2, expect.expandtabs(2))
self.assertEqual(d3, expect)
+ self.assertEqual(d4, d2)
+ self.assertEqual(d5, d3)
def test_indent0(self):
h = {3: 1}