def test_versionstring_2(): """ CLI-call '>lightpile --version' should print correct version. """ argv = ['--version'] expected_output = lightpile.__version__ with captured_out() as (out, err): with assert_raises(SystemExit): app.parse_commandline(argv) assert_equal(expected_output, out.getvalue().strip())
def test_garbageargument_2(): """ Do SystemExit and show 'usage' for bad CLI-arguments. """ argv = ['--garbage in '] expected_output = ("Usage:\n lightpile <lmc-file>\n" " lightpile -h | --help\n" " lightpile --version\n") with captured_out() as (out, err): with assert_raises(SystemExit): app.parse_commandline(argv) assert_equal(expected_output, out.getvalue())