@@ -116,24 +116,14 @@ def test_executions_client_from_service_account_info(client_class):
116
116
assert client .transport ._host == "workflowexecutions.googleapis.com:443"
117
117
118
118
119
- @pytest .mark .parametrize ("client_class" , [ExecutionsClient , ExecutionsAsyncClient ,])
120
- def test_executions_client_service_account_always_use_jwt (client_class ):
121
- with mock .patch .object (
122
- service_account .Credentials , "with_always_use_jwt_access" , create = True
123
- ) as use_jwt :
124
- creds = service_account .Credentials (None , None , None )
125
- client = client_class (credentials = creds )
126
- use_jwt .assert_not_called ()
127
-
128
-
129
119
@pytest .mark .parametrize (
130
120
"transport_class,transport_name" ,
131
121
[
132
122
(transports .ExecutionsGrpcTransport , "grpc" ),
133
123
(transports .ExecutionsGrpcAsyncIOTransport , "grpc_asyncio" ),
134
124
],
135
125
)
136
- def test_executions_client_service_account_always_use_jwt_true (
126
+ def test_executions_client_service_account_always_use_jwt (
137
127
transport_class , transport_name
138
128
):
139
129
with mock .patch .object (
@@ -143,6 +133,13 @@ def test_executions_client_service_account_always_use_jwt_true(
143
133
transport = transport_class (credentials = creds , always_use_jwt_access = True )
144
134
use_jwt .assert_called_once_with (True )
145
135
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
+ transport = transport_class (credentials = creds , always_use_jwt_access = False )
141
+ use_jwt .assert_not_called ()
142
+
146
143
147
144
@pytest .mark .parametrize ("client_class" , [ExecutionsClient , ExecutionsAsyncClient ,])
148
145
def test_executions_client_from_service_account_file (client_class ):
@@ -219,6 +216,7 @@ def test_executions_client_client_options(
219
216
client_cert_source_for_mtls = None ,
220
217
quota_project_id = None ,
221
218
client_info = transports .base .DEFAULT_CLIENT_INFO ,
219
+ always_use_jwt_access = True ,
222
220
)
223
221
224
222
# Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is
@@ -235,6 +233,7 @@ def test_executions_client_client_options(
235
233
client_cert_source_for_mtls = None ,
236
234
quota_project_id = None ,
237
235
client_info = transports .base .DEFAULT_CLIENT_INFO ,
236
+ always_use_jwt_access = True ,
238
237
)
239
238
240
239
# Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is
@@ -251,6 +250,7 @@ def test_executions_client_client_options(
251
250
client_cert_source_for_mtls = None ,
252
251
quota_project_id = None ,
253
252
client_info = transports .base .DEFAULT_CLIENT_INFO ,
253
+ always_use_jwt_access = True ,
254
254
)
255
255
256
256
# Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has
@@ -279,6 +279,7 @@ def test_executions_client_client_options(
279
279
client_cert_source_for_mtls = None ,
280
280
quota_project_id = "octopus" ,
281
281
client_info = transports .base .DEFAULT_CLIENT_INFO ,
282
+ always_use_jwt_access = True ,
282
283
)
283
284
284
285
@@ -343,6 +344,7 @@ def test_executions_client_mtls_env_auto(
343
344
client_cert_source_for_mtls = expected_client_cert_source ,
344
345
quota_project_id = None ,
345
346
client_info = transports .base .DEFAULT_CLIENT_INFO ,
347
+ always_use_jwt_access = True ,
346
348
)
347
349
348
350
# Check the case ADC client cert is provided. Whether client cert is used depends on
@@ -376,6 +378,7 @@ def test_executions_client_mtls_env_auto(
376
378
client_cert_source_for_mtls = expected_client_cert_source ,
377
379
quota_project_id = None ,
378
380
client_info = transports .base .DEFAULT_CLIENT_INFO ,
381
+ always_use_jwt_access = True ,
379
382
)
380
383
381
384
# Check the case client_cert_source and ADC client cert are not provided.
@@ -397,6 +400,7 @@ def test_executions_client_mtls_env_auto(
397
400
client_cert_source_for_mtls = None ,
398
401
quota_project_id = None ,
399
402
client_info = transports .base .DEFAULT_CLIENT_INFO ,
403
+ always_use_jwt_access = True ,
400
404
)
401
405
402
406
@@ -427,6 +431,7 @@ def test_executions_client_client_options_scopes(
427
431
client_cert_source_for_mtls = None ,
428
432
quota_project_id = None ,
429
433
client_info = transports .base .DEFAULT_CLIENT_INFO ,
434
+ always_use_jwt_access = True ,
430
435
)
431
436
432
437
@@ -457,6 +462,7 @@ def test_executions_client_client_options_credentials_file(
457
462
client_cert_source_for_mtls = None ,
458
463
quota_project_id = None ,
459
464
client_info = transports .base .DEFAULT_CLIENT_INFO ,
465
+ always_use_jwt_access = True ,
460
466
)
461
467
462
468
@@ -474,6 +480,7 @@ def test_executions_client_client_options_from_dict():
474
480
client_cert_source_for_mtls = None ,
475
481
quota_project_id = None ,
476
482
client_info = transports .base .DEFAULT_CLIENT_INFO ,
483
+ always_use_jwt_access = True ,
477
484
)
478
485
479
486
0 commit comments