def test_delete_stanza(self): service = Service([ Stanza('script://test1', {}), Stanza('package://test2', {}), Stanza('script://test3', {}), ]) r_config.delete_stanza(service, 'script', 'test3') r_config.delete_stanza(service, 'script', 'test1') for _ in r_config.iter_stanzas(service, 'script'): self.fail('No stanza should be found') cnt = 0 for stanza, name in r_config.iter_stanzas(service, 'package'): self.assertEqual('package://test2', stanza.name) cnt += 1 self.assertEqual(1, cnt)
def remove(service, name): r_config.delete_stanza(service, scheme, name)