예제 #1
0
 def test_register_and_call(self):
     cb = haplib.Callback()
     handler = Gadget()
     cb.register(1, handler)
     arg1 = "a"
     arg2 = None
     arg3 = 1.3
     arg4 = True
     command_code = 1
     cb(command_code, arg1, arg2, arg3=arg3, arg4=arg4)
     self.assertEquals((arg1, arg2, arg3, arg4), handler.args)
예제 #2
0
 def test_call_with_no_handlers(self):
     cb = haplib.Callback()
     command_code = 1
     cb(command_code)