def test_has_handlers(self):
     def handler(x):
         return 2 * x
     self.assertEqual(has_handlers('foo'), False)
     register_handler('foo', handler)
     self.assertEqual(has_handlers('foo'), True)
     remove_function(handler)
     self.assertEqual(has_handlers('foo'), False)
 def test_removemethods(self):
     class Foo(ActionHandler):
         def __init__(self):
             ActionHandler.__init__(self)
             self.test = "foobar"
         
         @register_method('foo')
         def foo(self, state):
             return self.test
         
         @register_method('bar')
         def bar(self, state):
             return "bar"
     
     foo = Foo()
     bar = Foo()   
     remove_handler('foo', foo.foo)
     self.assertEqual(emmit_action('foo'), ['foobar'])
     self.assert_(foo.foo not in _inst.actions['foo'])
     remove_function(bar.foo)
     self.assertEqual(emmit_action('foo'), [])