Beispiel #1
0
    def test_unregister(self):
        class GoodHook(HookBase):
            """"""

        hook = Hook()
        hook.register(GoodHook)
        self.assertListEqual(hook._registry, [GoodHook, ])
        hook.unregister(GoodHook)
        self.assertListEqual(hook._registry, [])

        # calling unregister again should do nothing
        hook.unregister(GoodHook)
        self.assertListEqual(hook._registry, [])