def test_specific_registry_clearing(self): Ent = type('Ent', (Registrable,), {}) Ent.make_registry() Sub = type('Sub', (Ent,), {}) Sub.register() self.assertTrue(Sub in Registry.entries_for(Ent)) Registry.clear(Ent) self.assertFalse(Sub in Registry.entries_for(Ent))
def test_specific_registry_clearing(self): Ent = type('Ent', (Registrable, ), {}) Ent.make_registry() Sub = type('Sub', (Ent, ), {}) Sub.register() self.assertTrue(Sub in Registry.entries_for(Ent)) Registry.clear(Ent) self.assertFalse(Sub in Registry.entries_for(Ent))
def test_global_registries_clearing(self): Ent1 = type('Ent1', (Registrable,), {}) Ent1.make_registry() Ent2 = type('Ent2', (Registrable,), {}) Ent2.make_registry() Registry.clear() with self.assertRaises(TypeError): Registry.entries_for(Ent1) with self.assertRaises(TypeError): Registry.entries_for(Ent2)
def test_global_registries_clearing(self): Ent1 = type('Ent1', (Registrable, ), {}) Ent1.make_registry() Ent2 = type('Ent2', (Registrable, ), {}) Ent2.make_registry() Registry.clear() with self.assertRaises(TypeError): Registry.entries_for(Ent1) with self.assertRaises(TypeError): Registry.entries_for(Ent2)
def tearDown(self): Registry.clear()