예제 #1
0
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
예제 #2
0
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
예제 #3
0
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
예제 #4
0
def test_main_for_default_case(capfd):
    argv = ["/usr/local/bin/assemble"]
    assemble.main(argv)

    out, err = capfd.readouterr()
    assert "default" in out