55"""
66
77import pytest
8- from glide_shared .exceptions import RequestError , ClosingError
8+ from glide_shared .exceptions import ClosingError , RequestError
99from glide_shared .routes import AllNodes
1010
1111from tests .async_tests .conftest import create_client
@@ -346,9 +346,11 @@ async def test_standalone_client_with_higher_database_ids(self, request):
346346 await client .close ()
347347 except (RequestError , ClosingError ) as e :
348348 # Connection-time error for invalid database
349- assert ("DB index is out of range" in str (e ) or
350- "invalid DB index" in str (e ) or
351- "refused to switch database" in str (e ))
349+ assert (
350+ "DB index is out of range" in str (e )
351+ or "invalid DB index" in str (e )
352+ or "refused to switch database" in str (e )
353+ )
352354
353355 @pytest .mark .asyncio
354356 async def test_standalone_client_with_very_high_database_ids (self , request ):
@@ -371,9 +373,11 @@ async def test_standalone_client_with_very_high_database_ids(self, request):
371373 await client .close ()
372374 except (RequestError , ClosingError ) as e :
373375 # Connection-time error for invalid database
374- assert ("DB index is out of range" in str (e ) or
375- "invalid DB index" in str (e ) or
376- "refused to switch database" in str (e ))
376+ assert (
377+ "DB index is out of range" in str (e )
378+ or "invalid DB index" in str (e )
379+ or "refused to switch database" in str (e )
380+ )
377381
378382 @pytest .mark .asyncio
379383 async def test_cluster_client_with_higher_database_ids (self , request ):
@@ -400,9 +404,11 @@ async def test_cluster_client_with_higher_database_ids(self, request):
400404 await client .close ()
401405 except (RequestError , ClosingError ) as e :
402406 # Connection-time error for invalid database
403- assert ("DB index is out of range" in str (e ) or
404- "invalid DB index" in str (e ) or
405- "refused to switch database" in str (e ))
407+ assert (
408+ "DB index is out of range" in str (e )
409+ or "invalid DB index" in str (e )
410+ or "refused to switch database" in str (e )
411+ )
406412
407413
408414class TestServerSideValidation :
@@ -433,9 +439,11 @@ async def test_server_side_validation_for_out_of_range_database_ids(self, reques
433439 await client .close ()
434440 except (RequestError , ClosingError ) as e :
435441 # Expected: server should reject connection to invalid database
436- assert ("DB index is out of range" in str (e ) or
437- "invalid DB index" in str (e ) or
438- "refused to switch database" in str (e ))
442+ assert (
443+ "DB index is out of range" in str (e )
444+ or "invalid DB index" in str (e )
445+ or "refused to switch database" in str (e )
446+ )
439447
440448 @pytest .mark .asyncio
441449 async def test_select_command_server_side_validation (self , request ):
0 commit comments