diff --git a/gapic/ads-templates/tests/unit/gapic/%name_%version/%sub/test_%service.py.j2 b/gapic/ads-templates/tests/unit/gapic/%name_%version/%sub/test_%service.py.j2 index 061c7dc987..4a158a4905 100644 --- a/gapic/ads-templates/tests/unit/gapic/%name_%version/%sub/test_%service.py.j2 +++ b/gapic/ads-templates/tests/unit/gapic/%name_%version/%sub/test_%service.py.j2 @@ -395,6 +395,7 @@ def test_{{ service.client_name|snake_case }}_client_options_credentials_file(cl always_use_jwt_access=True, ) + {% if 'grpc' in opts.transport %} # test that the credentials from file are saved and used as the credentials. with mock.patch.object( google.auth, "load_credentials_from_file", autospec=True @@ -412,7 +413,6 @@ def test_{{ service.client_name|snake_case }}_client_options_credentials_file(cl create_channel.assert_called_with( "{{ host }}{% if ":" not in service.host %}:443{% endif %}", credentials=file_creds, - credentials_file=None, quota_project_id=None, default_scopes=( {% for scope in service.oauth_scopes %} @@ -427,6 +427,7 @@ def test_{{ service.client_name|snake_case }}_client_options_credentials_file(cl ], ) {% endwith %} + {% endif %} {% if 'grpc' in opts.transport %} {# TODO(dovs): genericize this function#} @@ -1707,7 +1708,6 @@ def test_{{ service.name|snake_case }}_transport_create_channel(transport_class, create_channel.assert_called_with( "{{ host }}{% if ":" not in service.host %}:443{% endif %}", credentials=creds, - credentials_file=None, quota_project_id="octopus", default_scopes=( {% for scope in service.oauth_scopes %} diff --git a/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_%service.py.j2 b/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_%service.py.j2 index c14e6e8373..34f9493bcf 100644 --- a/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_%service.py.j2 +++ b/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_%service.py.j2 @@ -453,7 +453,7 @@ def test_{{ service.client_name|snake_case }}_client_options_scopes(client_class ({{ service.async_client_name }}, transports.{{ service.grpc_asyncio_transport_name }}, "grpc_asyncio", grpc_helpers_async), {% endif %} {% if 'rest' in opts.transport %} - ({{ service.client_name }}, transports.{{ service.rest_transport_name }}, "rest"), + ({{ service.client_name }}, transports.{{ service.rest_transport_name }}, "rest", ""), {% endif %} ]) def test_{{ service.client_name|snake_case }}_client_options_credentials_file(client_class, transport_class, transport_name, grpc_helpers): @@ -476,6 +476,7 @@ def test_{{ service.client_name|snake_case }}_client_options_credentials_file(cl always_use_jwt_access=True, ) + {% if 'grpc' in opts.transport %} # test that the credentials from file are saved and used as the credentials. with mock.patch.object( google.auth, "load_credentials_from_file", autospec=True @@ -493,7 +494,6 @@ def test_{{ service.client_name|snake_case }}_client_options_credentials_file(cl create_channel.assert_called_with( "{{ host }}{% if ":" not in service.host %}:443{% endif %}", credentials=file_creds, - credentials_file=None, quota_project_id=None, default_scopes=( {% for scope in service.oauth_scopes %} @@ -508,6 +508,7 @@ def test_{{ service.client_name|snake_case }}_client_options_credentials_file(cl ], ) {% endwith %} + {% endif %} {% if 'grpc' in opts.transport %} {# TODO(dovs): genericize this function#} @@ -2138,7 +2139,6 @@ def test_{{ service.name|snake_case }}_transport_create_channel(transport_class, create_channel.assert_called_with( "{{ host }}{% if ":" not in service.host %}:443{% endif %}", credentials=creds, - credentials_file=None, quota_project_id="octopus", default_scopes=( {% for scope in service.oauth_scopes %} diff --git a/tests/integration/goldens/asset/tests/unit/gapic/asset_v1/test_asset_service.py b/tests/integration/goldens/asset/tests/unit/gapic/asset_v1/test_asset_service.py index 8e0373ab44..cd27ee7948 100644 --- a/tests/integration/goldens/asset/tests/unit/gapic/asset_v1/test_asset_service.py +++ b/tests/integration/goldens/asset/tests/unit/gapic/asset_v1/test_asset_service.py @@ -434,7 +434,6 @@ def test_asset_service_client_client_options_credentials_file(client_class, tran create_channel.assert_called_with( "cloudasset.googleapis.com:443", credentials=file_creds, - credentials_file=None, quota_project_id=None, default_scopes=( 'https://www.googleapis.com/auth/cloud-platform', @@ -3784,7 +3783,6 @@ def test_asset_service_transport_create_channel(transport_class, grpc_helpers): create_channel.assert_called_with( "cloudasset.googleapis.com:443", credentials=creds, - credentials_file=None, quota_project_id="octopus", default_scopes=( 'https://www.googleapis.com/auth/cloud-platform', diff --git a/tests/integration/goldens/credentials/tests/unit/gapic/credentials_v1/test_iam_credentials.py b/tests/integration/goldens/credentials/tests/unit/gapic/credentials_v1/test_iam_credentials.py index 017b8cad45..fb7d416799 100644 --- a/tests/integration/goldens/credentials/tests/unit/gapic/credentials_v1/test_iam_credentials.py +++ b/tests/integration/goldens/credentials/tests/unit/gapic/credentials_v1/test_iam_credentials.py @@ -425,7 +425,6 @@ def test_iam_credentials_client_client_options_credentials_file(client_class, tr create_channel.assert_called_with( "iamcredentials.googleapis.com:443", credentials=file_creds, - credentials_file=None, quota_project_id=None, default_scopes=( 'https://www.googleapis.com/auth/cloud-platform', @@ -1714,7 +1713,6 @@ def test_iam_credentials_transport_create_channel(transport_class, grpc_helpers) create_channel.assert_called_with( "iamcredentials.googleapis.com:443", credentials=creds, - credentials_file=None, quota_project_id="octopus", default_scopes=( 'https://www.googleapis.com/auth/cloud-platform', diff --git a/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_config_service_v2.py b/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_config_service_v2.py index 87493338ce..6e2c987699 100644 --- a/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_config_service_v2.py +++ b/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_config_service_v2.py @@ -426,7 +426,6 @@ def test_config_service_v2_client_client_options_credentials_file(client_class, create_channel.assert_called_with( "logging.googleapis.com:443", credentials=file_creds, - credentials_file=None, quota_project_id=None, default_scopes=( 'https://www.googleapis.com/auth/cloud-platform', @@ -6173,7 +6172,6 @@ def test_config_service_v2_transport_create_channel(transport_class, grpc_helper create_channel.assert_called_with( "logging.googleapis.com:443", credentials=creds, - credentials_file=None, quota_project_id="octopus", default_scopes=( 'https://www.googleapis.com/auth/cloud-platform', diff --git a/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_logging_service_v2.py b/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_logging_service_v2.py index e2668aac46..bea40d2ab8 100644 --- a/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_logging_service_v2.py +++ b/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_logging_service_v2.py @@ -432,7 +432,6 @@ def test_logging_service_v2_client_client_options_credentials_file(client_class, create_channel.assert_called_with( "logging.googleapis.com:443", credentials=file_creds, - credentials_file=None, quota_project_id=None, default_scopes=( 'https://www.googleapis.com/auth/cloud-platform', @@ -2260,7 +2259,6 @@ def test_logging_service_v2_transport_create_channel(transport_class, grpc_helpe create_channel.assert_called_with( "logging.googleapis.com:443", credentials=creds, - credentials_file=None, quota_project_id="octopus", default_scopes=( 'https://www.googleapis.com/auth/cloud-platform', diff --git a/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_metrics_service_v2.py b/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_metrics_service_v2.py index eb91c00caf..d6721f9a70 100644 --- a/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_metrics_service_v2.py +++ b/tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_metrics_service_v2.py @@ -430,7 +430,6 @@ def test_metrics_service_v2_client_client_options_credentials_file(client_class, create_channel.assert_called_with( "logging.googleapis.com:443", credentials=file_creds, - credentials_file=None, quota_project_id=None, default_scopes=( 'https://www.googleapis.com/auth/cloud-platform', @@ -2113,7 +2112,6 @@ def test_metrics_service_v2_transport_create_channel(transport_class, grpc_helpe create_channel.assert_called_with( "logging.googleapis.com:443", credentials=creds, - credentials_file=None, quota_project_id="octopus", default_scopes=( 'https://www.googleapis.com/auth/cloud-platform', diff --git a/tests/integration/goldens/redis/tests/unit/gapic/redis_v1/test_cloud_redis.py b/tests/integration/goldens/redis/tests/unit/gapic/redis_v1/test_cloud_redis.py index 087858c344..38b42de9b7 100644 --- a/tests/integration/goldens/redis/tests/unit/gapic/redis_v1/test_cloud_redis.py +++ b/tests/integration/goldens/redis/tests/unit/gapic/redis_v1/test_cloud_redis.py @@ -431,7 +431,6 @@ def test_cloud_redis_client_client_options_credentials_file(client_class, transp create_channel.assert_called_with( "redis.googleapis.com:443", credentials=file_creds, - credentials_file=None, quota_project_id=None, default_scopes=( 'https://www.googleapis.com/auth/cloud-platform', @@ -3109,7 +3108,6 @@ def test_cloud_redis_transport_create_channel(transport_class, grpc_helpers): create_channel.assert_called_with( "redis.googleapis.com:443", credentials=creds, - credentials_file=None, quota_project_id="octopus", default_scopes=( 'https://www.googleapis.com/auth/cloud-platform',