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)
def test_call_with_no_handlers(self): cb = haplib.Callback() command_code = 1 cb(command_code)