def test_hook(self): hook = HookPoint("foo", "no docs", None, None) def callback(): pass hook.hook(callback, "my callback") self.assertEqual([callback], list(hook))
def test___repr(self): # The repr should list all the callbacks, with names. hook = HookPoint("foo", "no docs", None, None) def callback(): pass hook.hook(callback, "my callback") callback_repr = repr(callback) self.assertEqual( '<HookPoint(foo), callbacks=[%s(my callback)]>' % callback_repr, repr(hook))