镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content
This repository was archived by the owner on Aug 25, 2026. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ class {{ service.async_client_name }}:

{% for method in service.methods.values() %}
{% with method_name = method.safe_name|snake_case + "_unary" if method.operation_service else method.safe_name|snake_case %}
{%+ if not method.server_streaming %}async {% endif %}def {{ method_name }}(self,
async def {{ method_name }}(self,
{% endwith %}
{% if not method.client_streaming %}
request: Optional[Union[{{ method.input.ident }}, dict]] = None,
Expand Down Expand Up @@ -343,7 +343,7 @@ class {{ service.async_client_name }}:

# Send the request.
{%+ if not method.void %}response = {% endif %}
{% if not method.server_streaming %}await {% endif %}rpc(
rpc(
{% if not method.client_streaming %}
request,
{% else %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ async def test_{{ method_name }}_async(transport: str = 'grpc_asyncio', request_
message = await response.read()
assert isinstance(message, {{ method.output.ident }})
{% else %}
response = await response
assert isinstance(response, {{ method.client_output_async.ident }})
{% for field in method_output.fields.values() | rejectattr('message') %}
{% if not field.oneof or field.proto3_optional %}
Expand Down