@@ -129,26 +129,14 @@ def test_notebook_service_client_from_service_account_info(client_class):
129129 assert client .transport ._host == "notebooks.googleapis.com:443"
130130
131131
132- @pytest .mark .parametrize (
133- "client_class" , [NotebookServiceClient , NotebookServiceAsyncClient ,]
134- )
135- def test_notebook_service_client_service_account_always_use_jwt (client_class ):
136- with mock .patch .object (
137- service_account .Credentials , "with_always_use_jwt_access" , create = True
138- ) as use_jwt :
139- creds = service_account .Credentials (None , None , None )
140- client = client_class (credentials = creds )
141- use_jwt .assert_not_called ()
142-
143-
144132@pytest .mark .parametrize (
145133 "transport_class,transport_name" ,
146134 [
147135 (transports .NotebookServiceGrpcTransport , "grpc" ),
148136 (transports .NotebookServiceGrpcAsyncIOTransport , "grpc_asyncio" ),
149137 ],
150138)
151- def test_notebook_service_client_service_account_always_use_jwt_true (
139+ def test_notebook_service_client_service_account_always_use_jwt (
152140 transport_class , transport_name
153141):
154142 with mock .patch .object (
@@ -158,6 +146,13 @@ def test_notebook_service_client_service_account_always_use_jwt_true(
158146 transport = transport_class (credentials = creds , always_use_jwt_access = True )
159147 use_jwt .assert_called_once_with (True )
160148
149+ with mock .patch .object (
150+ service_account .Credentials , "with_always_use_jwt_access" , create = True
151+ ) as use_jwt :
152+ creds = service_account .Credentials (None , None , None )
153+ transport = transport_class (credentials = creds , always_use_jwt_access = False )
154+ use_jwt .assert_not_called ()
155+
161156
162157@pytest .mark .parametrize (
163158 "client_class" , [NotebookServiceClient , NotebookServiceAsyncClient ,]
@@ -238,6 +233,7 @@ def test_notebook_service_client_client_options(
238233 client_cert_source_for_mtls = None ,
239234 quota_project_id = None ,
240235 client_info = transports .base .DEFAULT_CLIENT_INFO ,
236+ always_use_jwt_access = True ,
241237 )
242238
243239 # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is
@@ -254,6 +250,7 @@ def test_notebook_service_client_client_options(
254250 client_cert_source_for_mtls = None ,
255251 quota_project_id = None ,
256252 client_info = transports .base .DEFAULT_CLIENT_INFO ,
253+ always_use_jwt_access = True ,
257254 )
258255
259256 # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is
@@ -270,6 +267,7 @@ def test_notebook_service_client_client_options(
270267 client_cert_source_for_mtls = None ,
271268 quota_project_id = None ,
272269 client_info = transports .base .DEFAULT_CLIENT_INFO ,
270+ always_use_jwt_access = True ,
273271 )
274272
275273 # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has
@@ -298,6 +296,7 @@ def test_notebook_service_client_client_options(
298296 client_cert_source_for_mtls = None ,
299297 quota_project_id = "octopus" ,
300298 client_info = transports .base .DEFAULT_CLIENT_INFO ,
299+ always_use_jwt_access = True ,
301300 )
302301
303302
@@ -374,6 +373,7 @@ def test_notebook_service_client_mtls_env_auto(
374373 client_cert_source_for_mtls = expected_client_cert_source ,
375374 quota_project_id = None ,
376375 client_info = transports .base .DEFAULT_CLIENT_INFO ,
376+ always_use_jwt_access = True ,
377377 )
378378
379379 # Check the case ADC client cert is provided. Whether client cert is used depends on
@@ -407,6 +407,7 @@ def test_notebook_service_client_mtls_env_auto(
407407 client_cert_source_for_mtls = expected_client_cert_source ,
408408 quota_project_id = None ,
409409 client_info = transports .base .DEFAULT_CLIENT_INFO ,
410+ always_use_jwt_access = True ,
410411 )
411412
412413 # Check the case client_cert_source and ADC client cert are not provided.
@@ -428,6 +429,7 @@ def test_notebook_service_client_mtls_env_auto(
428429 client_cert_source_for_mtls = None ,
429430 quota_project_id = None ,
430431 client_info = transports .base .DEFAULT_CLIENT_INFO ,
432+ always_use_jwt_access = True ,
431433 )
432434
433435
@@ -458,6 +460,7 @@ def test_notebook_service_client_client_options_scopes(
458460 client_cert_source_for_mtls = None ,
459461 quota_project_id = None ,
460462 client_info = transports .base .DEFAULT_CLIENT_INFO ,
463+ always_use_jwt_access = True ,
461464 )
462465
463466
@@ -488,6 +491,7 @@ def test_notebook_service_client_client_options_credentials_file(
488491 client_cert_source_for_mtls = None ,
489492 quota_project_id = None ,
490493 client_info = transports .base .DEFAULT_CLIENT_INFO ,
494+ always_use_jwt_access = True ,
491495 )
492496
493497
@@ -507,6 +511,7 @@ def test_notebook_service_client_client_options_from_dict():
507511 client_cert_source_for_mtls = None ,
508512 quota_project_id = None ,
509513 client_info = transports .base .DEFAULT_CLIENT_INFO ,
514+ always_use_jwt_access = True ,
510515 )
511516
512517
0 commit comments