This repository was archived by the owner on Mar 26, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
gapic/templates/%namespace/%name_%version/%sub/_compat
tests/integration/goldens
asset/google/cloud/asset_v1/_compat
redis/google/cloud/redis_v1/_compat Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ {% extends '_base.py.j2' %}
2+
3+ {% block content %}
14
25import os
36
7+ # try/except added for compatibility with python < 3.8
8+ try:
9+ from unittest import mock
10+ except ImportError: # pragma: NO COVER
11+ import mock
12+
413from google.auth.exceptions import MutualTLSChannelError # type: ignore
514
615def _read_environment_variables():
@@ -23,4 +32,6 @@ def _read_environment_variables():
2332 raise ValueError("Environment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be either `true` or `false`")
2433 if use_mtls_endpoint not in ("auto", "never", "always"):
2534 raise MutualTLSChannelError("Environment variable `GOOGLE_API_USE_MTLS_ENDPOINT` must be `never`, `auto` or `always`")
26- return use_client_cert == "true", use_mtls_endpoint, universe_domain_env
35+ return use_client_cert == "true", use_mtls_endpoint, universe_domain_env
36+
37+ {% endblock %}
Original file line number Diff line number Diff line change 1-
1+ # -*- coding: utf-8 -*-
2+ # Copyright 2025 Google LLC
3+ #
4+ # Licensed under the Apache License, Version 2.0 (the "License");
5+ # you may not use this file except in compliance with the License.
6+ # You may obtain a copy of the License at
7+ #
8+ # http://www.apache.org/licenses/LICENSE-2.0
9+ #
10+ # Unless required by applicable law or agreed to in writing, software
11+ # distributed under the License is distributed on an "AS IS" BASIS,
12+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ # See the License for the specific language governing permissions and
14+ # limitations under the License.
15+ #
216import os
317
18+ # try/except added for compatibility with python < 3.8
19+ try :
20+ from unittest import mock
21+ except ImportError : # pragma: NO COVER
22+ import mock
23+
424from google .auth .exceptions import MutualTLSChannelError # type: ignore
525
626def _read_environment_variables ():
Original file line number Diff line number Diff line change 1-
1+ # -*- coding: utf-8 -*-
2+ # Copyright 2025 Google LLC
3+ #
4+ # Licensed under the Apache License, Version 2.0 (the "License");
5+ # you may not use this file except in compliance with the License.
6+ # You may obtain a copy of the License at
7+ #
8+ # http://www.apache.org/licenses/LICENSE-2.0
9+ #
10+ # Unless required by applicable law or agreed to in writing, software
11+ # distributed under the License is distributed on an "AS IS" BASIS,
12+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ # See the License for the specific language governing permissions and
14+ # limitations under the License.
15+ #
216import os
317
18+ # try/except added for compatibility with python < 3.8
19+ try :
20+ from unittest import mock
21+ except ImportError : # pragma: NO COVER
22+ import mock
23+
424from google .auth .exceptions import MutualTLSChannelError # type: ignore
525
626def _read_environment_variables ():
You can’t perform that action at this time.
0 commit comments