@@ -27,7 +27,7 @@ def _make_credentials():
2727
2828@pytest .mark .skipif (
2929 sys .version_info < (3 , 10 ),
30- reason = "Async Client requires Python 3.10+ due to google-auth-library asyncio support"
30+ reason = "Async Client requires Python 3.10+ due to google-auth-library asyncio support" ,
3131)
3232class TestAsyncClient :
3333 @staticmethod
@@ -42,43 +42,64 @@ def test_ctor_defaults(self):
4242 credentials = _make_credentials ()
4343
4444 # We mock AsyncJSONConnection to prevent network logic during init
45- with mock .patch ("google.cloud.storage._experimental.asyncio.async_client.AsyncJSONConnection" ) as MockConn :
45+ with mock .patch (
46+ "google.cloud.storage._experimental.asyncio.async_client.AsyncJSONConnection"
47+ ) as MockConn :
4648 client = self ._make_one (project = PROJECT , credentials = credentials )
4749
4850 assert client .project == PROJECT
4951
5052 # It is the instance of the Mock
5153 assert isinstance (client ._json_connection , mock .Mock )
5254 assert client ._json_connection == MockConn .return_value
53- MockConn .assert_called_once_with (client , _async_http = None , credentials = client .credentials , client_info = None , api_endpoint = None )
55+ MockConn .assert_called_once_with (
56+ client ,
57+ _async_http = None ,
58+ credentials = client .credentials ,
59+ client_info = None ,
60+ api_endpoint = None ,
61+ )
5462
5563 def test_ctor_mtls_raises_error (self ):
5664 credentials = _make_credentials ()
5765
5866 # Simulate environment where mTLS is enabled
59- with mock .patch ("google.cloud.storage.abstracts.base_client.BaseClient._use_client_cert" , new_callable = mock .PropertyMock ) as mock_mtls :
67+ with mock .patch (
68+ "google.cloud.storage.abstracts.base_client.BaseClient._use_client_cert" ,
69+ new_callable = mock .PropertyMock ,
70+ ) as mock_mtls :
6071 mock_mtls .return_value = True
6172
62- with pytest .raises (ValueError , match = "Async Client currently do not support mTLS" ):
73+ with pytest .raises (
74+ ValueError , match = "Async Client currently do not support mTLS"
75+ ):
6376 self ._make_one (credentials = credentials )
6477
6578 def test_ctor_w_async_http_passed (self ):
6679 credentials = _make_credentials ()
6780 async_http = mock .Mock ()
6881
69- with mock .patch ("google.cloud.storage._experimental.asyncio.async_client.AsyncJSONConnection" ) as MockConn :
82+ with mock .patch (
83+ "google.cloud.storage._experimental.asyncio.async_client.AsyncJSONConnection"
84+ ) as MockConn :
7085 client = self ._make_one (
71- project = "PROJECT" ,
72- credentials = credentials ,
73- _async_http = async_http
86+ project = "PROJECT" , credentials = credentials , _async_http = async_http
7487 )
7588
7689 client ._json_connection
77- MockConn .assert_called_once_with (client , _async_http = async_http , credentials = client .credentials , client_info = None , api_endpoint = None )
90+ MockConn .assert_called_once_with (
91+ client ,
92+ _async_http = async_http ,
93+ credentials = client .credentials ,
94+ client_info = None ,
95+ api_endpoint = None ,
96+ )
7897
7998 def test_bucket_not_implemented (self ):
8099 credentials = _make_credentials ()
81- with mock .patch ("google.cloud.storage._experimental.asyncio.async_client.AsyncJSONConnection" ):
100+ with mock .patch (
101+ "google.cloud.storage._experimental.asyncio.async_client.AsyncJSONConnection"
102+ ):
82103 client = self ._make_one (project = "PROJECT" , credentials = credentials )
83104
84105 with pytest .raises (NotImplementedError ):
0 commit comments