Skip to content
Permalink
Browse files

feat(grpc): add a general purpose grpc service

  • Loading branch information...
hanxiao committed Aug 9, 2019
1 parent 3a767b7 commit 55126f2b3aea915d6ee3be84698ce800ff55383d
Showing with 6 additions and 5 deletions.
  1. +6 −5 tests/test_grpc_service.py
@@ -59,15 +59,16 @@ def setUp(self):
])

def test_grpc_empty_service(self):
with DummyServer('127.0.0.1:5678'), GRPCService(self.s_args):
with DummyServer('%s:%d' % (self.s_args.grpc_host, self.s_args.grpc_port)), GRPCService(self.s_args):
pass

@unittest.SkipTest
def test_grpc_real_service(self):
with DummyServer('127.0.0.1:5678'), GRPCService(self.s_args), FrontendService(self.args), grpc.insecure_channel(
'%s:%s' % (self.args.grpc_host, self.args.grpc_port),
options=[('grpc.max_send_message_length', 70 * 1024 * 1024),
('grpc.max_receive_message_length', 70 * 1024 * 1024)]) as channel:
with DummyServer('%s:%d' % (self.s_args.grpc_host, self.s_args.grpc_port)), GRPCService(
self.s_args), FrontendService(self.args), grpc.insecure_channel(
'%s:%s' % (self.args.grpc_host, self.args.grpc_port),
options=[('grpc.max_send_message_length', 70 * 1024 * 1024),
('grpc.max_receive_message_length', 70 * 1024 * 1024)]) as channel:
stub = gnes_pb2_grpc.GnesRPCStub(channel)
resp = stub.Call(list(RequestGenerator.query(b'abc', 1))[0])
self.assertEqual(resp.request_id, '0') # idx start with 0, but +1 for final FLUSH

0 comments on commit 55126f2

Please sign in to comment.
You can’t perform that action at this time.