예제 #1
0
 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"]
예제 #2
0
 def test_adding_hook(self):
     FileStorage.register_hook("example", ExampleHook)
     self.assertEqual(FileStorage.HOOKS["example"], ExampleHook)