def test_removing_hook(self): FileStorage.register_hook("example", ExampleFile) self.assertEqual(FileStorage.HOOKS["example"], ExampleFile) FileStorage.unregister_hook("example") with self.assertRaises(KeyError): FileStorage.HOOKS["example"]
def test_adding_hook(self): FileStorage.register_hook("example", ExampleHook) self.assertEqual(FileStorage.HOOKS["example"], ExampleHook)