def test_wait_for_request(self): rpc = Rpc(FakeConnection(), timeout=1) uuid = rpc.register_request(['travis-ci']) def delivery_payload(): time.sleep(0.1) rpc.on_frame(FakePayload(name='travis-ci')) thread = threading.Thread(target=delivery_payload) thread.start() rpc._wait_for_request( uuid, connection_adapter=rpc._default_connection_adapter)
def test_wait_for_request(self): rpc = Rpc(FakeConnection(), timeout=1) uuid = rpc.register_request(['travis-ci']) def delivery_payload(): time.sleep(0.1) rpc.on_frame(FakePayload(name='travis-ci')) thread = threading.Thread(target=delivery_payload) thread.start() rpc._wait_for_request( uuid, connection_adapter=rpc._default_connection_adapter )
def test_with_for_request_with_custom_adapter(self): class Adapter(object): def check_for_errors(self): pass rpc = Rpc(FakeConnection(), timeout=1) uuid = rpc.register_request(['travis-ci']) def delivery_payload(): time.sleep(0.1) rpc.on_frame(FakePayload(name='travis-ci')) thread = threading.Thread(target=delivery_payload) thread.start() rpc._wait_for_request(uuid, Adapter())
def test_with_for_request_with_custom_adapter(self): class Adapter(object): def check_for_errors(self): pass rpc = Rpc(FakeConnection(), timeout=1) uuid = rpc.register_request(['travis-ci']) def delivery_payload(): time.sleep(0.1) rpc.on_frame(FakePayload(name='travis-ci')) thread = threading.Thread(target=delivery_payload) thread.start() rpc._wait_for_request(uuid, Adapter())