def test_save_configuration_with_invalid_cfg(monkeypatch, config): monkeypatch.delitem(config, 'hosters') with pytest.raises(ConfigurationException) as exceptionInfo: functions.save_configuration(config) assert (str(exceptionInfo.value) == ' -> \'hosters\' is a required property')
def test_save_configuration_missig_dynamic_properties(monkeypatch, config): monkeypatch.delitem(config, 'working_directory') monkeypatch.delitem(config, 'config_path') with pytest.raises(ConfigurationException) as exceptionInfo: functions.save_configuration(config) assert (str(exceptionInfo.value) == 'Missing dynamic properties' '(working_directory and/or config_path)')
def test_save_configuration_happy_path(config): functions.save_configuration(config) assert len(open(config['config_path']).read()) == 91