File tree 2 files changed +3
-17
lines changed
2 files changed +3
-17
lines changed Original file line number Diff line number Diff line change @@ -197,16 +197,15 @@ def wrap_errors(callable_):
197
197
Returns: Callable: The wrapped gRPC callable.
198
198
"""
199
199
grpc_helpers ._patch_callable_name (callable_ )
200
- if isinstance (callable_ , aio .UnaryUnaryMultiCallable ):
201
- return _wrap_unary_errors (callable_ )
202
- elif isinstance (callable_ , aio .UnaryStreamMultiCallable ):
200
+
201
+ if isinstance (callable_ , aio .UnaryStreamMultiCallable ):
203
202
return _wrap_stream_errors (callable_ , _WrappedUnaryStreamCall )
204
203
elif isinstance (callable_ , aio .StreamUnaryMultiCallable ):
205
204
return _wrap_stream_errors (callable_ , _WrappedStreamUnaryCall )
206
205
elif isinstance (callable_ , aio .StreamStreamMultiCallable ):
207
206
return _wrap_stream_errors (callable_ , _WrappedStreamStreamCall )
208
207
else :
209
- raise TypeError ( "Unexpected type of callable: {}" . format ( type ( callable_ )) )
208
+ return _wrap_unary_errors ( callable_ )
210
209
211
210
212
211
def create_channel (
Original file line number Diff line number Diff line change @@ -165,19 +165,6 @@ async def test_wrap_stream_errors_stream_stream():
165
165
assert mock_call .wait_for_connection .call_count == 1
166
166
167
167
168
- @pytest .mark .asyncio
169
- async def test_wrap_errors_type_error ():
170
- """
171
- If wrap_errors is called with an unexpected type, it should raise a TypeError.
172
- """
173
- mock_call = mock .Mock ()
174
- multicallable = mock .Mock (return_value = mock_call )
175
-
176
- with pytest .raises (TypeError ) as exc :
177
- grpc_helpers_async .wrap_errors (multicallable )
178
- assert "Unexpected type" in str (exc .value )
179
-
180
-
181
168
@pytest .mark .asyncio
182
169
async def test_wrap_stream_errors_raised ():
183
170
grpc_error = RpcErrorImpl (grpc .StatusCode .INVALID_ARGUMENT )
You can’t perform that action at this time.
0 commit comments