def test_config_update() -> None: config = Config() config.update(config.dump()) assert config == Config()
def test_config_update_bad_data_format(data: Any) -> None: config = Config() with pytest.raises(ConfigFileError) as err: # noinspection PyTypeChecker config.update(data) assert str(err.value).startswith("B")
def test_config_update_bad_key(key: str) -> None: config = Config() with pytest.raises(ConfigKeyError) as err: config.update({key: None}) assert str(err.value).startswith("Bad configuration key")
def test_config_update_bad_value(key): config = Config() with pytest.raises(ConfigValueError) as err: config.update({key: None}) assert str(err.value).startswith("Bad value for configuration key")