def test_inline_callbacks_exception1(self): reactor.reset() def print_result(result=None, error=None): assert error print "error", error[0] f = asynch_fct4() f.set_callback(print_result) reactor.call_later(1, reactor.stop) reactor.run() print "stop" assert f.completed
def test_inline_callbacks(self): reactor.reset() def print_result(result=None, error=None): print "result", result assert result == 18 f = asynch_fct2() f.set_callback(print_result) reactor.call_later(0.6, reactor.stop) reactor.run() print "stop" assert f.completed