@@ -222,19 +222,45 @@ def test_get_timeouts_invalid(self, input_times):
222222 _helpers ._align_timeouts (input_times [0 ], input_times [1 ])
223223
224224
225- class TestReadRowsPredicateWithException :
225+ class TestRstStreamAwarePredicate :
226226 @pytest .mark .parametrize (
227227 "retryable_exceptions,exception,expected_is_retryable" ,
228228 [
229- ([core_exceptions .Aborted , core_exceptions .InternalServerError ], core_exceptions .InternalServerError ("Sorry" ), True ),
230- ([core_exceptions .Aborted , core_exceptions .InternalServerError ], core_exceptions .DataLoss ("Sorry" ), False ),
231- ([core_exceptions .ServiceUnavailable , core_exceptions .Aborted ], core_exceptions .InternalServerError ("Sorry" ), False ),
232- ([core_exceptions .ServiceUnavailable , core_exceptions .Aborted ], core_exceptions .InternalServerError (_helpers ._RETRYABLE_INTERNAL_ERROR_MESSAGES [0 ]), True ),
233- ([core_exceptions .InternalServerError , core_exceptions .Aborted ], core_exceptions .InternalServerError (_helpers ._RETRYABLE_INTERNAL_ERROR_MESSAGES [0 ]), True ),
234- ]
229+ (
230+ [core_exceptions .Aborted , core_exceptions .InternalServerError ],
231+ core_exceptions .InternalServerError ("Sorry" ),
232+ True ,
233+ ),
234+ (
235+ [core_exceptions .Aborted , core_exceptions .InternalServerError ],
236+ core_exceptions .DataLoss ("Sorry" ),
237+ False ,
238+ ),
239+ (
240+ [core_exceptions .ServiceUnavailable , core_exceptions .Aborted ],
241+ core_exceptions .InternalServerError ("Sorry" ),
242+ False ,
243+ ),
244+ (
245+ [core_exceptions .ServiceUnavailable , core_exceptions .Aborted ],
246+ core_exceptions .InternalServerError (
247+ _helpers ._RETRYABLE_INTERNAL_ERROR_MESSAGES [0 ]
248+ ),
249+ True ,
250+ ),
251+ (
252+ [core_exceptions .InternalServerError , core_exceptions .Aborted ],
253+ core_exceptions .InternalServerError (
254+ _helpers ._RETRYABLE_INTERNAL_ERROR_MESSAGES [0 ]
255+ ),
256+ True ,
257+ ),
258+ ],
235259 )
236- def test_ctor_retryable_exceptions_predicate (self , retryable_exceptions , exception , expected_is_retryable ):
237- predicate = _helpers ._read_rows_predicate_with_exceptions (* retryable_exceptions )
260+ def test_rst_stream_aware_predicate (
261+ self , retryable_exceptions , exception , expected_is_retryable
262+ ):
263+ predicate = _helpers ._rst_stream_aware_predicate (* retryable_exceptions )
238264 assert predicate (exception ) is expected_is_retryable
239265
240266
0 commit comments