def protocol_version(client): def done(result): client.test_done("ok") client.PROTOCOL_VERSION = -1 d = client.protocol_version() d.addCallbacks(client.test_fail, done)
def send_message(): if (client.messages_sent % 2) == 0: # one ping, one protocol version d = client.ping() else: d = client.protocol_version() d.addCallbacks(done, client.test_fail) client.messages_sent += 1 client.pending_tests += 1
def auth(client): yield client.protocol_version() proto = called[0] # check that the producers match # backend transport is the frontend producer self.assertIdentical(proto.peer.transport, proto.transport.producer) # frontend transport is the backend producer self.assertIdentical(proto.transport, proto.peer.transport.producer)
def auth(client): yield client.protocol_version() proto = called[0] # check that the producers match # backend transport is the frontend producer self.assertIdentical( proto.peer.transport, proto.transport.producer) # frontend transport is the backend producer self.assertIdentical( proto.transport, proto.peer.transport.producer)
def protocol_version(client): def done(result): client.test_done("ok") d = client.protocol_version() d.addCallbacks(done, client.test_fail)
def auth(client): yield client.protocol_version()