@@ -125,7 +125,25 @@ def test_cloud_billing_client_service_account_always_use_jwt(client_class):
125125 ) as use_jwt :
126126 creds = service_account .Credentials (None , None , None )
127127 client = client_class (credentials = creds )
128- use_jwt .assert_called_with (True )
128+ use_jwt .assert_not_called ()
129+
130+
131+ @pytest .mark .parametrize (
132+ "transport_class,transport_name" ,
133+ [
134+ (transports .CloudBillingGrpcTransport , "grpc" ),
135+ (transports .CloudBillingGrpcAsyncIOTransport , "grpc_asyncio" ),
136+ ],
137+ )
138+ def test_cloud_billing_client_service_account_always_use_jwt_true (
139+ transport_class , transport_name
140+ ):
141+ with mock .patch .object (
142+ service_account .Credentials , "with_always_use_jwt_access" , create = True
143+ ) as use_jwt :
144+ creds = service_account .Credentials (None , None , None )
145+ transport = transport_class (credentials = creds , always_use_jwt_access = True )
146+ use_jwt .assert_called_once_with (True )
129147
130148
131149@pytest .mark .parametrize ("client_class" , [CloudBillingClient , CloudBillingAsyncClient ,])
@@ -3165,7 +3183,7 @@ def test_cloud_billing_grpc_transport_client_cert_source_for_mtls(transport_clas
31653183 "squid.clam.whelk:443" ,
31663184 credentials = cred ,
31673185 credentials_file = None ,
3168- scopes = ( "https://www.googleapis.com/auth/cloud-platform" ,) ,
3186+ scopes = None ,
31693187 ssl_credentials = mock_ssl_channel_creds ,
31703188 quota_project_id = None ,
31713189 options = [
@@ -3269,7 +3287,7 @@ def test_cloud_billing_transport_channel_mtls_with_client_cert_source(transport_
32693287 "mtls.squid.clam.whelk:443" ,
32703288 credentials = cred ,
32713289 credentials_file = None ,
3272- scopes = ( "https://www.googleapis.com/auth/cloud-platform" ,) ,
3290+ scopes = None ,
32733291 ssl_credentials = mock_ssl_cred ,
32743292 quota_project_id = None ,
32753293 options = [
@@ -3313,7 +3331,7 @@ def test_cloud_billing_transport_channel_mtls_with_adc(transport_class):
33133331 "mtls.squid.clam.whelk:443" ,
33143332 credentials = mock_cred ,
33153333 credentials_file = None ,
3316- scopes = ( "https://www.googleapis.com/auth/cloud-platform" ,) ,
3334+ scopes = None ,
33173335 ssl_credentials = mock_ssl_cred ,
33183336 quota_project_id = None ,
33193337 options = [
0 commit comments