Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_validate_format(setup_cfg_path):
updater = ConfigUpdater(allow_no_value=False)
updater.read(setup_cfg_path)
updater.validate_format()
updater.set('metadata', 'author')
with pytest.raises(ParsingError):
updater.validate_format()
def test_handle_error():
updater = ConfigUpdater(allow_no_value=False)
with pytest.raises(ParsingError):
updater.read_string(test_wrong_cfg)