Skip to content

Commit 1f56844

Browse files
test(spanner): clear context-aware mTLS env var in unit tests
Unset CLOUDSDK_CONTEXT_AWARE_USE_CLIENT_CERTIFICATE in mTLS unit tests to prevent failures in Google and Kokoro CI environments.
1 parent 270c7fe commit 1f56844

21 files changed

Lines changed: 297 additions & 139 deletions

File tree

packages/gapic-generator/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_%service.py.j2

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -896,6 +896,7 @@ def test_{{ service.client_name|snake_case }}_get_mtls_endpoint_and_cert_source(
896896
for config_data, expected_cert_source in test_cases:
897897
env = os.environ.copy()
898898
env.pop("GOOGLE_API_USE_CLIENT_CERTIFICATE", None)
899+
env.pop("CLOUDSDK_CONTEXT_AWARE_USE_CLIENT_CERTIFICATE", None)
899900
with mock.patch.dict(os.environ, env, clear=True):
900901
config_filename = "mock_certificate_config.json"
901902
config_file_content = json.dumps(config_data)
@@ -943,6 +944,7 @@ def test_{{ service.client_name|snake_case }}_get_mtls_endpoint_and_cert_source(
943944
for config_data, expected_cert_source in test_cases:
944945
env = os.environ.copy()
945946
env.pop("GOOGLE_API_USE_CLIENT_CERTIFICATE", "")
947+
env.pop("CLOUDSDK_CONTEXT_AWARE_USE_CLIENT_CERTIFICATE", "")
946948
with mock.patch.dict(os.environ, env, clear=True):
947949
config_filename = "mock_certificate_config.json"
948950
config_file_content = json.dumps(config_data)
@@ -963,13 +965,25 @@ def test_{{ service.client_name|snake_case }}_get_mtls_endpoint_and_cert_source(
963965
assert cert_source is expected_cert_source
964966

965967
# Test the case GOOGLE_API_USE_MTLS_ENDPOINT is "never".
966-
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}):
968+
with mock.patch.dict(
969+
os.environ,
970+
{
971+
"GOOGLE_API_USE_MTLS_ENDPOINT": "never",
972+
"GOOGLE_API_USE_CLIENT_CERTIFICATE": "false",
973+
},
974+
):
967975
api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source()
968976
assert api_endpoint == client_class.DEFAULT_ENDPOINT
969977
assert cert_source is None
970978

971979
# Test the case GOOGLE_API_USE_MTLS_ENDPOINT is "always".
972-
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}):
980+
with mock.patch.dict(
981+
os.environ,
982+
{
983+
"GOOGLE_API_USE_MTLS_ENDPOINT": "always",
984+
"GOOGLE_API_USE_CLIENT_CERTIFICATE": "false",
985+
},
986+
):
973987
api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source()
974988
assert api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT
975989
assert cert_source is None

packages/gapic-generator/tests/integration/goldens/asset/tests/unit/gapic/asset_v1/test_asset_service.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,10 @@ def test__read_environment_variables():
163163
None,
164164
)
165165

166-
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}):
166+
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never", "GOOGLE_API_USE_CLIENT_CERTIFICATE": "false"}):
167167
assert AssetServiceClient._read_environment_variables() == (False, "never", None)
168168

169-
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}):
169+
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always", "GOOGLE_API_USE_CLIENT_CERTIFICATE": "false"}):
170170
assert AssetServiceClient._read_environment_variables() == (False, "always", None)
171171

172172
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "auto"}):
@@ -467,7 +467,7 @@ def test_asset_service_client_client_options(client_class, transport_class, tran
467467

468468
# Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is
469469
# "never".
470-
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}):
470+
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never", "GOOGLE_API_USE_CLIENT_CERTIFICATE": "false"}):
471471
with mock.patch.object(transport_class, '__init__') as patched:
472472
patched.return_value = None
473473
client = client_class(transport=transport_name)
@@ -485,7 +485,7 @@ def test_asset_service_client_client_options(client_class, transport_class, tran
485485

486486
# Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is
487487
# "always".
488-
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}):
488+
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always", "GOOGLE_API_USE_CLIENT_CERTIFICATE": "false"}):
489489
with mock.patch.object(transport_class, '__init__') as patched:
490490
patched.return_value = None
491491
client = client_class(transport=transport_name)
@@ -696,6 +696,7 @@ def test_asset_service_client_get_mtls_endpoint_and_cert_source(client_class):
696696
for config_data, expected_cert_source in test_cases:
697697
env = os.environ.copy()
698698
env.pop("GOOGLE_API_USE_CLIENT_CERTIFICATE", None)
699+
env.pop("CLOUDSDK_CONTEXT_AWARE_USE_CLIENT_CERTIFICATE", None)
699700
with mock.patch.dict(os.environ, env, clear=True):
700701
config_filename = "mock_certificate_config.json"
701702
config_file_content = json.dumps(config_data)
@@ -743,6 +744,7 @@ def test_asset_service_client_get_mtls_endpoint_and_cert_source(client_class):
743744
for config_data, expected_cert_source in test_cases:
744745
env = os.environ.copy()
745746
env.pop("GOOGLE_API_USE_CLIENT_CERTIFICATE", "")
747+
env.pop("CLOUDSDK_CONTEXT_AWARE_USE_CLIENT_CERTIFICATE", "")
746748
with mock.patch.dict(os.environ, env, clear=True):
747749
config_filename = "mock_certificate_config.json"
748750
config_file_content = json.dumps(config_data)
@@ -763,13 +765,13 @@ def test_asset_service_client_get_mtls_endpoint_and_cert_source(client_class):
763765
assert cert_source is expected_cert_source
764766

765767
# Test the case GOOGLE_API_USE_MTLS_ENDPOINT is "never".
766-
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}):
768+
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never", "GOOGLE_API_USE_CLIENT_CERTIFICATE": "false"}):
767769
api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source()
768770
assert api_endpoint == client_class.DEFAULT_ENDPOINT
769771
assert cert_source is None
770772

771773
# Test the case GOOGLE_API_USE_MTLS_ENDPOINT is "always".
772-
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}):
774+
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always", "GOOGLE_API_USE_CLIENT_CERTIFICATE": "false"}):
773775
api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source()
774776
assert api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT
775777
assert cert_source is None
@@ -820,13 +822,13 @@ def test_asset_service_client_client_api_endpoint(client_class):
820822

821823
# If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="never",
822824
# use the _DEFAULT_ENDPOINT_TEMPLATE populated with GDU as the api endpoint.
823-
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}):
825+
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never", "GOOGLE_API_USE_CLIENT_CERTIFICATE": "false"}):
824826
client = client_class(credentials=ga_credentials.AnonymousCredentials())
825827
assert client.api_endpoint == default_endpoint
826828

827829
# If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="always",
828830
# use the DEFAULT_MTLS_ENDPOINT as the api endpoint.
829-
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}):
831+
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always", "GOOGLE_API_USE_CLIENT_CERTIFICATE": "false"}):
830832
client = client_class(credentials=ga_credentials.AnonymousCredentials())
831833
assert client.api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT
832834

@@ -849,7 +851,7 @@ def test_asset_service_client_client_api_endpoint(client_class):
849851
options = client_options.ClientOptions()
850852
if hasattr(options, "universe_domain"):
851853
delattr(options, "universe_domain")
852-
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}):
854+
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never", "GOOGLE_API_USE_CLIENT_CERTIFICATE": "false"}):
853855
client = client_class(client_options=options, credentials=ga_credentials.AnonymousCredentials())
854856
assert client.api_endpoint == default_endpoint
855857

packages/gapic-generator/tests/integration/goldens/credentials/tests/unit/gapic/credentials_v1/test_iam_credentials.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,10 @@ def test__read_environment_variables():
153153
None,
154154
)
155155

156-
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}):
156+
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never", "GOOGLE_API_USE_CLIENT_CERTIFICATE": "false"}):
157157
assert IAMCredentialsClient._read_environment_variables() == (False, "never", None)
158158

159-
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}):
159+
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always", "GOOGLE_API_USE_CLIENT_CERTIFICATE": "false"}):
160160
assert IAMCredentialsClient._read_environment_variables() == (False, "always", None)
161161

162162
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "auto"}):
@@ -457,7 +457,7 @@ def test_iam_credentials_client_client_options(client_class, transport_class, tr
457457

458458
# Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is
459459
# "never".
460-
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}):
460+
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never", "GOOGLE_API_USE_CLIENT_CERTIFICATE": "false"}):
461461
with mock.patch.object(transport_class, '__init__') as patched:
462462
patched.return_value = None
463463
client = client_class(transport=transport_name)
@@ -475,7 +475,7 @@ def test_iam_credentials_client_client_options(client_class, transport_class, tr
475475

476476
# Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is
477477
# "always".
478-
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}):
478+
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always", "GOOGLE_API_USE_CLIENT_CERTIFICATE": "false"}):
479479
with mock.patch.object(transport_class, '__init__') as patched:
480480
patched.return_value = None
481481
client = client_class(transport=transport_name)
@@ -686,6 +686,7 @@ def test_iam_credentials_client_get_mtls_endpoint_and_cert_source(client_class):
686686
for config_data, expected_cert_source in test_cases:
687687
env = os.environ.copy()
688688
env.pop("GOOGLE_API_USE_CLIENT_CERTIFICATE", None)
689+
env.pop("CLOUDSDK_CONTEXT_AWARE_USE_CLIENT_CERTIFICATE", None)
689690
with mock.patch.dict(os.environ, env, clear=True):
690691
config_filename = "mock_certificate_config.json"
691692
config_file_content = json.dumps(config_data)
@@ -733,6 +734,7 @@ def test_iam_credentials_client_get_mtls_endpoint_and_cert_source(client_class):
733734
for config_data, expected_cert_source in test_cases:
734735
env = os.environ.copy()
735736
env.pop("GOOGLE_API_USE_CLIENT_CERTIFICATE", "")
737+
env.pop("CLOUDSDK_CONTEXT_AWARE_USE_CLIENT_CERTIFICATE", "")
736738
with mock.patch.dict(os.environ, env, clear=True):
737739
config_filename = "mock_certificate_config.json"
738740
config_file_content = json.dumps(config_data)
@@ -753,13 +755,13 @@ def test_iam_credentials_client_get_mtls_endpoint_and_cert_source(client_class):
753755
assert cert_source is expected_cert_source
754756

755757
# Test the case GOOGLE_API_USE_MTLS_ENDPOINT is "never".
756-
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}):
758+
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never", "GOOGLE_API_USE_CLIENT_CERTIFICATE": "false"}):
757759
api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source()
758760
assert api_endpoint == client_class.DEFAULT_ENDPOINT
759761
assert cert_source is None
760762

761763
# Test the case GOOGLE_API_USE_MTLS_ENDPOINT is "always".
762-
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}):
764+
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always", "GOOGLE_API_USE_CLIENT_CERTIFICATE": "false"}):
763765
api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source()
764766
assert api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT
765767
assert cert_source is None
@@ -810,13 +812,13 @@ def test_iam_credentials_client_client_api_endpoint(client_class):
810812

811813
# If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="never",
812814
# use the _DEFAULT_ENDPOINT_TEMPLATE populated with GDU as the api endpoint.
813-
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}):
815+
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never", "GOOGLE_API_USE_CLIENT_CERTIFICATE": "false"}):
814816
client = client_class(credentials=ga_credentials.AnonymousCredentials())
815817
assert client.api_endpoint == default_endpoint
816818

817819
# If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="always",
818820
# use the DEFAULT_MTLS_ENDPOINT as the api endpoint.
819-
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}):
821+
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always", "GOOGLE_API_USE_CLIENT_CERTIFICATE": "false"}):
820822
client = client_class(credentials=ga_credentials.AnonymousCredentials())
821823
assert client.api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT
822824

@@ -839,7 +841,7 @@ def test_iam_credentials_client_client_api_endpoint(client_class):
839841
options = client_options.ClientOptions()
840842
if hasattr(options, "universe_domain"):
841843
delattr(options, "universe_domain")
842-
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}):
844+
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never", "GOOGLE_API_USE_CLIENT_CERTIFICATE": "false"}):
843845
client = client_class(client_options=options, credentials=ga_credentials.AnonymousCredentials())
844846
assert client.api_endpoint == default_endpoint
845847

packages/gapic-generator/tests/integration/goldens/eventarc/tests/unit/gapic/eventarc_v1/test_eventarc.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,10 @@ def test__read_environment_variables():
184184
None,
185185
)
186186

187-
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}):
187+
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never", "GOOGLE_API_USE_CLIENT_CERTIFICATE": "false"}):
188188
assert EventarcClient._read_environment_variables() == (False, "never", None)
189189

190-
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}):
190+
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always", "GOOGLE_API_USE_CLIENT_CERTIFICATE": "false"}):
191191
assert EventarcClient._read_environment_variables() == (False, "always", None)
192192

193193
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "auto"}):
@@ -488,7 +488,7 @@ def test_eventarc_client_client_options(client_class, transport_class, transport
488488

489489
# Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is
490490
# "never".
491-
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}):
491+
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never", "GOOGLE_API_USE_CLIENT_CERTIFICATE": "false"}):
492492
with mock.patch.object(transport_class, '__init__') as patched:
493493
patched.return_value = None
494494
client = client_class(transport=transport_name)
@@ -506,7 +506,7 @@ def test_eventarc_client_client_options(client_class, transport_class, transport
506506

507507
# Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is
508508
# "always".
509-
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}):
509+
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always", "GOOGLE_API_USE_CLIENT_CERTIFICATE": "false"}):
510510
with mock.patch.object(transport_class, '__init__') as patched:
511511
patched.return_value = None
512512
client = client_class(transport=transport_name)
@@ -717,6 +717,7 @@ def test_eventarc_client_get_mtls_endpoint_and_cert_source(client_class):
717717
for config_data, expected_cert_source in test_cases:
718718
env = os.environ.copy()
719719
env.pop("GOOGLE_API_USE_CLIENT_CERTIFICATE", None)
720+
env.pop("CLOUDSDK_CONTEXT_AWARE_USE_CLIENT_CERTIFICATE", None)
720721
with mock.patch.dict(os.environ, env, clear=True):
721722
config_filename = "mock_certificate_config.json"
722723
config_file_content = json.dumps(config_data)
@@ -764,6 +765,7 @@ def test_eventarc_client_get_mtls_endpoint_and_cert_source(client_class):
764765
for config_data, expected_cert_source in test_cases:
765766
env = os.environ.copy()
766767
env.pop("GOOGLE_API_USE_CLIENT_CERTIFICATE", "")
768+
env.pop("CLOUDSDK_CONTEXT_AWARE_USE_CLIENT_CERTIFICATE", "")
767769
with mock.patch.dict(os.environ, env, clear=True):
768770
config_filename = "mock_certificate_config.json"
769771
config_file_content = json.dumps(config_data)
@@ -784,13 +786,13 @@ def test_eventarc_client_get_mtls_endpoint_and_cert_source(client_class):
784786
assert cert_source is expected_cert_source
785787

786788
# Test the case GOOGLE_API_USE_MTLS_ENDPOINT is "never".
787-
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}):
789+
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never", "GOOGLE_API_USE_CLIENT_CERTIFICATE": "false"}):
788790
api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source()
789791
assert api_endpoint == client_class.DEFAULT_ENDPOINT
790792
assert cert_source is None
791793

792794
# Test the case GOOGLE_API_USE_MTLS_ENDPOINT is "always".
793-
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}):
795+
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always", "GOOGLE_API_USE_CLIENT_CERTIFICATE": "false"}):
794796
api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source()
795797
assert api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT
796798
assert cert_source is None
@@ -841,13 +843,13 @@ def test_eventarc_client_client_api_endpoint(client_class):
841843

842844
# If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="never",
843845
# use the _DEFAULT_ENDPOINT_TEMPLATE populated with GDU as the api endpoint.
844-
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}):
846+
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never", "GOOGLE_API_USE_CLIENT_CERTIFICATE": "false"}):
845847
client = client_class(credentials=ga_credentials.AnonymousCredentials())
846848
assert client.api_endpoint == default_endpoint
847849

848850
# If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="always",
849851
# use the DEFAULT_MTLS_ENDPOINT as the api endpoint.
850-
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}):
852+
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always", "GOOGLE_API_USE_CLIENT_CERTIFICATE": "false"}):
851853
client = client_class(credentials=ga_credentials.AnonymousCredentials())
852854
assert client.api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT
853855

@@ -870,7 +872,7 @@ def test_eventarc_client_client_api_endpoint(client_class):
870872
options = client_options.ClientOptions()
871873
if hasattr(options, "universe_domain"):
872874
delattr(options, "universe_domain")
873-
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}):
875+
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never", "GOOGLE_API_USE_CLIENT_CERTIFICATE": "false"}):
874876
client = client_class(client_options=options, credentials=ga_credentials.AnonymousCredentials())
875877
assert client.api_endpoint == default_endpoint
876878

0 commit comments

Comments
 (0)