def test_setup_config(): expected_context = Context() expected_context.config = get_fake_valid_config() with pytest.raises(SystemExit): setup_config(None) actual_context = setup_config("beetmoverscript/test/fake_config.json") assert expected_context.config == actual_context.config args = ['beetmoverscript', "beetmoverscript/test/fake_config.json"] with mock.patch.object(sys, 'argv', args): actual_context = setup_config(None) assert expected_context.config == actual_context.config
def test_setup_config(): expected_context = Context() expected_context.config = get_fake_valid_config() actual_context = setup_config("beetmoverscript/test/fake_config.json") assert expected_context.config == actual_context.config
def test_invalid_args(): args = ['only-one-arg'] with mock.patch.object(sys, 'argv', args): with pytest.raises(SystemExit): setup_config(None)