File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -186,7 +186,7 @@ async def test_wrap_stream_errors_raised():
186
186
187
187
188
188
@pytest .mark .asyncio
189
- async def test_wrap_stream_errors_read ():
189
+ async def test_wrap_stream_errors_read_with_grpc_error ():
190
190
grpc_error = RpcErrorImpl (grpc .StatusCode .INVALID_ARGUMENT )
191
191
192
192
mock_call = mock .Mock (aio .StreamStreamCall , autospec = True )
@@ -206,6 +206,23 @@ async def test_wrap_stream_errors_read():
206
206
assert exc_info .value .response == grpc_error
207
207
208
208
209
+ @pytest .mark .asyncio
210
+ async def test_wrap_stream_errors_read_without_grpc_error ():
211
+ mock_call = mock .Mock (aio .StreamStreamCall , autospec = True )
212
+
213
+ mock_call .read = mock .AsyncMock ()
214
+ multicallable = mock .Mock (return_value = mock_call )
215
+
216
+ wrapped_callable = grpc_helpers_async ._wrap_stream_errors (
217
+ multicallable , grpc_helpers_async ._WrappedStreamStreamCall
218
+ )
219
+
220
+ wrapped_call = await wrapped_callable (1 , 2 , three = "four" )
221
+ multicallable .assert_called_once_with (1 , 2 , three = "four" )
222
+ assert mock_call .wait_for_connection .call_count == 1
223
+ await wrapped_call .read ()
224
+
225
+
209
226
@pytest .mark .asyncio
210
227
async def test_wrap_stream_errors_aiter ():
211
228
grpc_error = RpcErrorImpl (grpc .StatusCode .INVALID_ARGUMENT )
You can’t perform that action at this time.
0 commit comments