Beispiel #1
0
def test_invalid_args():
    args = ['only-one-arg']
    with mock.patch.object(sys, 'argv', args):
        with pytest.raises(SystemExit) as e:
            setup_config(None)
            assert e.type == SystemExit
            assert e.value.code == 2

    args = ['balrogscript', 'balrogscript/test/data/hardcoded_config.json']
    with mock.patch.object(sys, 'argv', args):
        config = setup_config(None)
        assert config['artifact_dir'] == 'balrogscript/data/balrog_task_schema.json'
def test_invalid_args():
    args = ["only-one-arg"]
    with mock.patch.object(sys, "argv", args):
        with pytest.raises(SystemExit) as e:
            setup_config(None)
            assert e.type == SystemExit
            assert e.value.code == 2

    args = ["balrogscript", "tests/data/hardcoded_config.json"]
    with mock.patch.object(sys, "argv", args):
        config = setup_config(None)
        assert config[
            "artifact_dir"] == "balrogscript/data/balrog_task_schema.json"