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_duplicate_option_error():
updater = ConfigUpdater()
with pytest.raises(DuplicateOptionError):
updater.read_string(test10_dup_option)
def test_no_duplicate_blocks_with_blockbuilder():
updater = ConfigUpdater()
updater.read_string(test19_cfg_in)
with pytest.raises(DuplicateOptionError):
updater['section']['Key0'].add_after.option('key0', '1')
with pytest.raises(DuplicateSectionError):
updater['section'].add_after.section('section')
assert str(updater) == test19_cfg_in