def test_load_missing_file(): settings = Settings() file_path = '/does/not/exist/62c889d0-39a0-4f5b-838b-abb635dee5fc.txt' with pytest.raises(IOError): # noinspection PyProtectedMember settings._load(file_path)
def test_load_file(): settings = Settings() # noinspection PyProtectedMember settings._load(asset_config_path) assert settings.FOO == 'bar' assert settings.BAR == [1, 2, 3]
def test_read_missing_key(): settings = Settings() with pytest.raises(AttributeError): assert settings.DOES_NOT_EXIST
def test_set_settings(): settings = Settings() settings.NEW_KEY = 'new_value' assert settings.NEW_KEY == 'new_value'