summaryrefslogtreecommitdiff
path: root/Lib/test/test_json/test_tool.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_json/test_tool.py')
-rw-r--r--Lib/test/test_json/test_tool.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_json/test_tool.py b/Lib/test/test_json/test_tool.py
index 0c39e56837..5484a8a7ca 100644
--- a/Lib/test/test_json/test_tool.py
+++ b/Lib/test/test_json/test_tool.py
@@ -55,6 +55,7 @@ class TestTool(unittest.TestCase):
def test_infile_stdout(self):
infile = self._create_infile()
rc, out, err = assert_python_ok('-m', 'json.tool', infile)
+ self.assertEqual(rc, 0)
self.assertEqual(out.splitlines(), self.expect.encode().splitlines())
self.assertEqual(err, b'')
@@ -65,5 +66,12 @@ class TestTool(unittest.TestCase):
self.addCleanup(os.remove, outfile)
with open(outfile, "r") as fp:
self.assertEqual(fp.read(), self.expect)
+ self.assertEqual(rc, 0)
self.assertEqual(out, b'')
self.assertEqual(err, b'')
+
+ def test_help_flag(self):
+ rc, out, err = assert_python_ok('-m', 'json.tool', '-h')
+ self.assertEqual(rc, 0)
+ self.assertTrue(out.startswith(b'usage: '))
+ self.assertEqual(err, b'')