Make test pass after the merge

pull/21647/head
Lidi Zheng 5 years ago
parent 6d556914d0
commit f9397de161
  1. 6
      src/python/grpcio/grpc/_cython/_cygrpc/aio/server.pyx.pxi
  2. 7
      src/python/grpcio/grpc/experimental/aio/_interceptor.py

@ -157,10 +157,9 @@ cdef class _ServicerContext:
return self._rpc_state.invocation_metadata()
cdef _find_method_handler(str method, list generic_handlers):
# TODO(lidiz) connects Metadata to call details
cdef _find_method_handler(str method, tuple metadata, list generic_handlers):
cdef _HandlerCallDetails handler_call_details = _HandlerCallDetails(method,
None)
metadata)
for generic_handler in generic_handlers:
method_handler = generic_handler.service(handler_call_details)
@ -459,6 +458,7 @@ async def _handle_rpc(list generic_handlers, RPCState rpc_state, object loop):
# Finds the method handler (application logic)
method_handler = _find_method_handler(
rpc_state.method().decode(),
rpc_state.invocation_metadata(),
generic_handlers,
)
if method_handler is None:

@ -106,14 +106,14 @@ class InterceptedUnaryUnaryCall(_base_call.UnaryUnaryCall):
def __init__( # pylint: disable=R0913
self, interceptors: Sequence[UnaryUnaryClientInterceptor],
request: RequestType, timeout: Optional[float],
credentials: Optional[grpc.CallCredentials],
metadata: Optional[MetadataType], credentials: Optional[grpc.CallCredentials],
channel: cygrpc.AioChannel, method: bytes,
request_serializer: SerializingFunction,
response_deserializer: DeserializingFunction) -> None:
self._channel = channel
self._loop = asyncio.get_event_loop()
self._interceptors_task = asyncio.ensure_future(
self._invoke(interceptors, method, timeout, credentials, request,
self._invoke(interceptors, method, timeout, metadata, credentials, request,
request_serializer, response_deserializer))
def __del__(self):
@ -122,6 +122,7 @@ class InterceptedUnaryUnaryCall(_base_call.UnaryUnaryCall):
async def _invoke( # pylint: disable=R0913
self, interceptors: Sequence[UnaryUnaryClientInterceptor],
method: bytes, timeout: Optional[float],
metadata: Optional[MetadataType],
credentials: Optional[grpc.CallCredentials], request: RequestType,
request_serializer: SerializingFunction,
response_deserializer: DeserializingFunction) -> UnaryUnaryCall:
@ -148,7 +149,7 @@ class InterceptedUnaryUnaryCall(_base_call.UnaryUnaryCall):
else:
return UnaryUnaryCall(
request, _timeout_to_deadline(client_call_details.timeout),
client_call_details.credentials, self._channel,
metadata, client_call_details.credentials, self._channel,
client_call_details.method, request_serializer,
response_deserializer)

Loading…
Cancel
Save