This commit is contained in:
Roman v. Gemmeren
2020-09-18 21:58:31 +00:00
committed by GitHub
3 changed files with 42 additions and 1 deletions

View File

@@ -26,6 +26,7 @@ import shutil
import sys
import tempfile
import unittest
import json
from tests.common import build_temp_workspace
@@ -608,3 +609,11 @@ class CommandLineTestCase(unittest.TestCase):
'\n' % path)
self.assertEqual(
(ctx.returncode, ctx.stdout, ctx.stderr), (1, expected_out, ''))
def test_json_output(self):
path = os.path.join(self.wd, 'a.yaml')
with RunContext(self) as ctx:
cli.run(('-f', 'json', path))
print (ctx.stdout)
self.assertTrue(json.loads(ctx.stdout))