File tree 1 file changed +21
-0
lines changed
1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -250,3 +250,24 @@ def __init__(self, response=object()):
250
250
def __await__ (self ):
251
251
response = yield from self ._future .__await__ ()
252
252
return response
253
+
254
+
255
+ class FakeStreamUnaryCall (_WrappedStreamUnaryCall ):
256
+ """Fake implementation for stream-unary RPCs.
257
+
258
+ It is a dummy object for response message. Supply the intended response
259
+ upon the initialization, and the coroutine will return the exact response
260
+ message.
261
+ """
262
+
263
+ def __init__ (self , response = object ()):
264
+ self .response = response
265
+ self ._future = asyncio .get_event_loop ().create_future ()
266
+ self ._future .set_result (self .response )
267
+
268
+ def __await__ (self ):
269
+ response = yield from self ._future .__await__ ()
270
+ return response
271
+
272
+ async def wait_for_connection (self ):
273
+ pass
You can’t perform that action at this time.
0 commit comments