@@ -129,26 +129,14 @@ def test_connection_service_client_from_service_account_info(client_class):
129
129
assert client .transport ._host == "bigqueryconnection.googleapis.com:443"
130
130
131
131
132
- @pytest .mark .parametrize (
133
- "client_class" , [ConnectionServiceClient , ConnectionServiceAsyncClient ,]
134
- )
135
- def test_connection_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
-
144
132
@pytest .mark .parametrize (
145
133
"transport_class,transport_name" ,
146
134
[
147
135
(transports .ConnectionServiceGrpcTransport , "grpc" ),
148
136
(transports .ConnectionServiceGrpcAsyncIOTransport , "grpc_asyncio" ),
149
137
],
150
138
)
151
- def test_connection_service_client_service_account_always_use_jwt_true (
139
+ def test_connection_service_client_service_account_always_use_jwt (
152
140
transport_class , transport_name
153
141
):
154
142
with mock .patch .object (
@@ -158,6 +146,13 @@ def test_connection_service_client_service_account_always_use_jwt_true(
158
146
transport = transport_class (credentials = creds , always_use_jwt_access = True )
159
147
use_jwt .assert_called_once_with (True )
160
148
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
+
161
156
162
157
@pytest .mark .parametrize (
163
158
"client_class" , [ConnectionServiceClient , ConnectionServiceAsyncClient ,]
@@ -238,6 +233,7 @@ def test_connection_service_client_client_options(
238
233
client_cert_source_for_mtls = None ,
239
234
quota_project_id = None ,
240
235
client_info = transports .base .DEFAULT_CLIENT_INFO ,
236
+ always_use_jwt_access = True ,
241
237
)
242
238
243
239
# Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is
@@ -254,6 +250,7 @@ def test_connection_service_client_client_options(
254
250
client_cert_source_for_mtls = None ,
255
251
quota_project_id = None ,
256
252
client_info = transports .base .DEFAULT_CLIENT_INFO ,
253
+ always_use_jwt_access = True ,
257
254
)
258
255
259
256
# Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is
@@ -270,6 +267,7 @@ def test_connection_service_client_client_options(
270
267
client_cert_source_for_mtls = None ,
271
268
quota_project_id = None ,
272
269
client_info = transports .base .DEFAULT_CLIENT_INFO ,
270
+ always_use_jwt_access = True ,
273
271
)
274
272
275
273
# Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has
@@ -298,6 +296,7 @@ def test_connection_service_client_client_options(
298
296
client_cert_source_for_mtls = None ,
299
297
quota_project_id = "octopus" ,
300
298
client_info = transports .base .DEFAULT_CLIENT_INFO ,
299
+ always_use_jwt_access = True ,
301
300
)
302
301
303
302
@@ -374,6 +373,7 @@ def test_connection_service_client_mtls_env_auto(
374
373
client_cert_source_for_mtls = expected_client_cert_source ,
375
374
quota_project_id = None ,
376
375
client_info = transports .base .DEFAULT_CLIENT_INFO ,
376
+ always_use_jwt_access = True ,
377
377
)
378
378
379
379
# Check the case ADC client cert is provided. Whether client cert is used depends on
@@ -407,6 +407,7 @@ def test_connection_service_client_mtls_env_auto(
407
407
client_cert_source_for_mtls = expected_client_cert_source ,
408
408
quota_project_id = None ,
409
409
client_info = transports .base .DEFAULT_CLIENT_INFO ,
410
+ always_use_jwt_access = True ,
410
411
)
411
412
412
413
# Check the case client_cert_source and ADC client cert are not provided.
@@ -428,6 +429,7 @@ def test_connection_service_client_mtls_env_auto(
428
429
client_cert_source_for_mtls = None ,
429
430
quota_project_id = None ,
430
431
client_info = transports .base .DEFAULT_CLIENT_INFO ,
432
+ always_use_jwt_access = True ,
431
433
)
432
434
433
435
@@ -458,6 +460,7 @@ def test_connection_service_client_client_options_scopes(
458
460
client_cert_source_for_mtls = None ,
459
461
quota_project_id = None ,
460
462
client_info = transports .base .DEFAULT_CLIENT_INFO ,
463
+ always_use_jwt_access = True ,
461
464
)
462
465
463
466
@@ -488,6 +491,7 @@ def test_connection_service_client_client_options_credentials_file(
488
491
client_cert_source_for_mtls = None ,
489
492
quota_project_id = None ,
490
493
client_info = transports .base .DEFAULT_CLIENT_INFO ,
494
+ always_use_jwt_access = True ,
491
495
)
492
496
493
497
@@ -507,6 +511,7 @@ def test_connection_service_client_client_options_from_dict():
507
511
client_cert_source_for_mtls = None ,
508
512
quota_project_id = None ,
509
513
client_info = transports .base .DEFAULT_CLIENT_INFO ,
514
+ always_use_jwt_access = True ,
510
515
)
511
516
512
517
0 commit comments