Add missing metadata TypeError case

Code formatted.
pull/23045/head
Mariano Anaya 5 years ago
parent 18e0f9f533
commit 376c0f0767
  1. 3
      src/python/grpcio/grpc/experimental/aio/_base_call.py
  2. 6
      src/python/grpcio/grpc/experimental/aio/_base_server.py
  3. 4
      src/python/grpcio/grpc/experimental/aio/_interceptor.py
  4. 4
      src/python/grpcio_tests/tests_aio/unit/metadata_test.py

@ -23,8 +23,7 @@ from typing import AsyncIterable, Awaitable, Generic, Optional, Union
import grpc
from ._typing import (DoneCallbackType, EOFType, RequestType,
ResponseType)
from ._typing import (DoneCallbackType, EOFType, RequestType, ResponseType)
from ._metadata import Metadata
__all__ = 'RpcContext', 'Call', 'UnaryUnaryCall', 'UnaryStreamCall'

@ -158,8 +158,7 @@ class ServicerContext(Generic[RequestType, ResponseType], abc.ABC):
"""
@abc.abstractmethod
async def send_initial_metadata(self,
initial_metadata: Metadata) -> None:
async def send_initial_metadata(self, initial_metadata: Metadata) -> None:
"""Sends the initial metadata value to the client.
This method need not be called by implementations if they have no
@ -191,8 +190,7 @@ class ServicerContext(Generic[RequestType, ResponseType], abc.ABC):
"""
@abc.abstractmethod
async def set_trailing_metadata(self,
trailing_metadata: Metadata) -> None:
async def set_trailing_metadata(self, trailing_metadata: Metadata) -> None:
"""Sends the trailing metadata for the RPC.
This method need not be called by implementations if they have no

@ -27,8 +27,8 @@ from ._call import _RPC_ALREADY_FINISHED_DETAILS, _RPC_HALF_CLOSED_DETAILS
from ._call import _API_STYLE_ERROR
from ._utils import _timeout_to_deadline
from ._typing import (RequestType, SerializingFunction, DeserializingFunction,
ResponseType, DoneCallbackType,
RequestIterableType, ResponseIterableType)
ResponseType, DoneCallbackType, RequestIterableType,
ResponseIterableType)
from ._metadata import Metadata
_LOCAL_CANCELLATION_DETAILS = 'Locally cancelled by application!'

@ -65,6 +65,10 @@ _INVALID_METADATA_TEST_CASES = (
TypeError,
((None, {}),),
),
(
TypeError,
(({}, {}),),
),
(
TypeError,
(('normal', object()),),

Loading…
Cancel
Save