@@ -123,7 +123,25 @@ def test_executions_client_service_account_always_use_jwt(client_class):
123
123
) as use_jwt :
124
124
creds = service_account .Credentials (None , None , None )
125
125
client = client_class (credentials = creds )
126
- use_jwt .assert_called_with (True )
126
+ use_jwt .assert_not_called ()
127
+
128
+
129
+ @pytest .mark .parametrize (
130
+ "transport_class,transport_name" ,
131
+ [
132
+ (transports .ExecutionsGrpcTransport , "grpc" ),
133
+ (transports .ExecutionsGrpcAsyncIOTransport , "grpc_asyncio" ),
134
+ ],
135
+ )
136
+ def test_executions_client_service_account_always_use_jwt_true (
137
+ transport_class , transport_name
138
+ ):
139
+ with mock .patch .object (
140
+ service_account .Credentials , "with_always_use_jwt_access" , create = True
141
+ ) as use_jwt :
142
+ creds = service_account .Credentials (None , None , None )
143
+ transport = transport_class (credentials = creds , always_use_jwt_access = True )
144
+ use_jwt .assert_called_once_with (True )
127
145
128
146
129
147
@pytest .mark .parametrize ("client_class" , [ExecutionsClient , ExecutionsAsyncClient ,])
@@ -1723,7 +1741,7 @@ def test_executions_grpc_transport_client_cert_source_for_mtls(transport_class):
1723
1741
"squid.clam.whelk:443" ,
1724
1742
credentials = cred ,
1725
1743
credentials_file = None ,
1726
- scopes = ( "https://www.googleapis.com/auth/cloud-platform" ,) ,
1744
+ scopes = None ,
1727
1745
ssl_credentials = mock_ssl_channel_creds ,
1728
1746
quota_project_id = None ,
1729
1747
options = [
@@ -1827,7 +1845,7 @@ def test_executions_transport_channel_mtls_with_client_cert_source(transport_cla
1827
1845
"mtls.squid.clam.whelk:443" ,
1828
1846
credentials = cred ,
1829
1847
credentials_file = None ,
1830
- scopes = ( "https://www.googleapis.com/auth/cloud-platform" ,) ,
1848
+ scopes = None ,
1831
1849
ssl_credentials = mock_ssl_cred ,
1832
1850
quota_project_id = None ,
1833
1851
options = [
@@ -1871,7 +1889,7 @@ def test_executions_transport_channel_mtls_with_adc(transport_class):
1871
1889
"mtls.squid.clam.whelk:443" ,
1872
1890
credentials = mock_cred ,
1873
1891
credentials_file = None ,
1874
- scopes = ( "https://www.googleapis.com/auth/cloud-platform" ,) ,
1892
+ scopes = None ,
1875
1893
ssl_credentials = mock_ssl_cred ,
1876
1894
quota_project_id = None ,
1877
1895
options = [
0 commit comments