コード例 #1
0
ファイル: test_future.py プロジェクト: sirk390/coinpy
 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
コード例 #2
0
ファイル: test_future.py プロジェクト: sirk390/coinpy
 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
コード例 #3
0
    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
コード例 #4
0
    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