@@ -138,7 +138,25 @@ def test_logging_service_v2_client_service_account_always_use_jwt(client_class):
138
138
) as use_jwt :
139
139
creds = service_account .Credentials (None , None , None )
140
140
client = client_class (credentials = creds )
141
- use_jwt .assert_called_with (True )
141
+ use_jwt .assert_not_called ()
142
+
143
+
144
+ @pytest .mark .parametrize (
145
+ "transport_class,transport_name" ,
146
+ [
147
+ (transports .LoggingServiceV2GrpcTransport , "grpc" ),
148
+ (transports .LoggingServiceV2GrpcAsyncIOTransport , "grpc_asyncio" ),
149
+ ],
150
+ )
151
+ def test_logging_service_v2_client_service_account_always_use_jwt_true (
152
+ transport_class , transport_name
153
+ ):
154
+ with mock .patch .object (
155
+ service_account .Credentials , "with_always_use_jwt_access" , create = True
156
+ ) as use_jwt :
157
+ creds = service_account .Credentials (None , None , None )
158
+ transport = transport_class (credentials = creds , always_use_jwt_access = True )
159
+ use_jwt .assert_called_once_with (True )
142
160
143
161
144
162
@pytest .mark .parametrize (
@@ -2164,13 +2182,7 @@ def test_logging_service_v2_grpc_transport_client_cert_source_for_mtls(transport
2164
2182
"squid.clam.whelk:443" ,
2165
2183
credentials = cred ,
2166
2184
credentials_file = None ,
2167
- scopes = (
2168
- "https://www.googleapis.com/auth/cloud-platform" ,
2169
- "https://www.googleapis.com/auth/cloud-platform.read-only" ,
2170
- "https://www.googleapis.com/auth/logging.admin" ,
2171
- "https://www.googleapis.com/auth/logging.read" ,
2172
- "https://www.googleapis.com/auth/logging.write" ,
2173
- ),
2185
+ scopes = None ,
2174
2186
ssl_credentials = mock_ssl_channel_creds ,
2175
2187
quota_project_id = None ,
2176
2188
options = [
@@ -2279,13 +2291,7 @@ def test_logging_service_v2_transport_channel_mtls_with_client_cert_source(
2279
2291
"mtls.squid.clam.whelk:443" ,
2280
2292
credentials = cred ,
2281
2293
credentials_file = None ,
2282
- scopes = (
2283
- "https://www.googleapis.com/auth/cloud-platform" ,
2284
- "https://www.googleapis.com/auth/cloud-platform.read-only" ,
2285
- "https://www.googleapis.com/auth/logging.admin" ,
2286
- "https://www.googleapis.com/auth/logging.read" ,
2287
- "https://www.googleapis.com/auth/logging.write" ,
2288
- ),
2294
+ scopes = None ,
2289
2295
ssl_credentials = mock_ssl_cred ,
2290
2296
quota_project_id = None ,
2291
2297
options = [
@@ -2332,13 +2338,7 @@ def test_logging_service_v2_transport_channel_mtls_with_adc(transport_class):
2332
2338
"mtls.squid.clam.whelk:443" ,
2333
2339
credentials = mock_cred ,
2334
2340
credentials_file = None ,
2335
- scopes = (
2336
- "https://www.googleapis.com/auth/cloud-platform" ,
2337
- "https://www.googleapis.com/auth/cloud-platform.read-only" ,
2338
- "https://www.googleapis.com/auth/logging.admin" ,
2339
- "https://www.googleapis.com/auth/logging.read" ,
2340
- "https://www.googleapis.com/auth/logging.write" ,
2341
- ),
2341
+ scopes = None ,
2342
2342
ssl_credentials = mock_ssl_cred ,
2343
2343
quota_project_id = None ,
2344
2344
options = [
0 commit comments