Skip to content

Commit

Permalink
fix all the existing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
public committed Apr 26, 2021
1 parent 915b07a commit 7d1f040
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion sonora/asgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ async def _do_unary_response(
self, rpc_method, receive, send, wrap_message, context, coroutine
):
headers = context._response_headers

if coroutine is None:
message = None
else:
Expand Down
5 changes: 4 additions & 1 deletion sonora/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ def __init__(self, session, url, path, request_serializer, request_deserializer)
self._path = path
self._rpc_url = urljoin(url, path)

self._metadata = [("x-user-agent", "grpc-web-python/0.1"), ('content-type', 'application/grpc-web+proto')]
self._metadata = [
("x-user-agent", "grpc-web-python/0.1"),
("content-type", "application/grpc-web+proto"),
]

self._serializer = request_serializer
self._deserializer = request_deserializer
Expand Down
4 changes: 2 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ async def HelloMetadata(self, request, context):
for key, value in context.invocation_metadata()
)

await context.set_trailing_metadata(
context.set_trailing_metadata(
(f"trailing-{key}", repr(value))
for key, value in context.invocation_metadata()
)
Expand All @@ -139,7 +139,7 @@ async def HelloStreamMetadata(self, request, context):
for c in value:
yield helloworld_pb2.HelloReply(message=c)

await context.set_trailing_metadata(
context.set_trailing_metadata(
(f"trailing-{key}", repr(value))
for key, value in context.invocation_metadata()
)
Expand Down

0 comments on commit 7d1f040

Please sign in to comment.