Пример #1
0
def test_help(playbook, capsys, help_dir):
    with pytest.raises(SystemExit) as excinfo:
        obal.main([playbook.name, '--help'])
    assert excinfo.value.code == 0

    captured = capsys.readouterr()

    help_file = help_dir / '{}.txt'.format(playbook.name)

    if help_file.check(exists=1):
        assert help_file.read() == captured.out
    else:
        help_file.write(captured.out)
        raise pytest.skip('Written help text')
Пример #2
0
def run_obal(args, exitcode):
    with pytest.raises(SystemExit) as excinfo:
        obal.main(args + DEFAULT_ARGS)
    assert excinfo.value.code == exitcode
Пример #3
0
"""
Main module file. This allows you to run python -m obal
"""
from obal import main  # pylint:disable=no-name-in-module
main()