def call_with_address(self, service, request, address): with self.lock: socket = self.bus.ctx.socket(zmq.REQ) socket.connect(address) socket.send(call.encode_req(service, request)) s = socket.recv() return call.decode_res(s)
def test_encode_req(self): self.assertEqual(msgpack.packb(['hello', 123]), call.encode_req('hello', 123))
def test_decode_req(self): self.assertEqual(['hello', 123], call.decode_req(call.encode_req('hello', 123)))