예제 #1
0
def _test_parse_arguments_help(capsys, help):
    with pytest.raises(SystemExit) as ex:
        mount_efs.parse_arguments_early_exit(["mount", "foo", "bar", help])

    assert 0 == ex.value.code

    out, err = capsys.readouterr()
    assert "Usage:" in out
예제 #2
0
def _test_parse_arguments_help(capsys, help):
    with pytest.raises(SystemExit) as ex:
        mount_efs.parse_arguments_early_exit(['mount', 'foo', 'bar', help])

    assert 0 == ex.value.code

    out, err = capsys.readouterr()
    assert 'Usage:' in out
예제 #3
0
def test_parse_arguments_version(capsys):
    with pytest.raises(SystemExit) as ex:
        mount_efs.parse_arguments_early_exit(
            ["mount", "foo", "bar", "--version"])

    assert 0 == ex.value.code

    out, err = capsys.readouterr()
    assert "Version: %s" % mount_efs.VERSION in out
예제 #4
0
def test_parse_arguments_version(capsys):
    with pytest.raises(SystemExit) as ex:
        mount_efs.parse_arguments_early_exit(
            ['mount', 'foo', 'bar', '--version'])

    assert 0 == ex.value.code

    out, err = capsys.readouterr()
    assert 'Version: %s' % mount_efs.VERSION in out