예제 #1
0
 def teardown_gateways(self, reporter, channels):
     for channel in channels:
         #try:
         try:
             repevent.wrapcall(reporter, channel.waitclose, 1)
         except IOError: # timeout
             # force closing
             channel.close()
         channel.gateway.exit()
예제 #2
0
def test_wrapcall_ok():
    l = []
    def ok(x):
        return x+1
    i = repevent.wrapcall(l.append, ok, 1)
    assert i == 2
    assert len(l) == 2
    assert isinstance(l[0], repevent.CallStart) 
    assert isinstance(l[1], repevent.CallFinish) 
    assert repr(l[0]) 
    assert repr(l[1])