Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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