Fix _stream_unary not working with empty iterables (#422)
* Fixed `do_many_things` method in `ThingService` * Added test for empty iterables * Fixed `_stream_unary` not sending request first
This commit is contained in:
committed by
GitHub
parent
24db53290e
commit
e309513131
@@ -27,7 +27,7 @@ class ThingService:
|
||||
async def do_many_things(
|
||||
self, stream: "grpclib.server.Stream[DoThingRequest, DoThingResponse]"
|
||||
):
|
||||
thing_names = [request.name for request in stream]
|
||||
thing_names = [request.name async for request in stream]
|
||||
if self.test_hook is not None:
|
||||
self.test_hook(stream)
|
||||
await stream.send_message(DoThingResponse(thing_names))
|
||||
|
||||
Reference in New Issue
Block a user