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_get_method(setup_cfg_path):
updater = ConfigUpdater()
updater.read(setup_cfg_path)
value = updater.get('metadata', 'license').value
assert value == 'mit'
with pytest.raises(NoSectionError):
updater.get('non_existent_section', 'license')
with pytest.raises(NoOptionError):
updater.get('metadata', 'wrong_key')