def test_main_for_task_which_doesnt_expect_args(capfd): argv = ["/usr/local/bin/assemble", "df", "foo"] assemble.main(argv) out, err = capfd.readouterr() assert "Filesystem" in out
def test_main_for_task_with_args(capfd): argv = ["/usr/local/bin/assemble", "name", "python"] assemble.main(argv) out, err = capfd.readouterr() assert "python" in out
def test_main_when_task_is_missing(): argv = ["/usr/local/bin/assemble", "bang"] with pytest.raises(SystemExit) as exc: assemble.main(argv) assert exc.value.code == 2
def test_main_for_default_case(capfd): argv = ["/usr/local/bin/assemble"] assemble.main(argv) out, err = capfd.readouterr() assert "default" in out