Skip to content

Commit c0b7860

Browse files
committed
style(api-core): format code with ruff
1 parent 1abba92 commit c0b7860

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

packages/google-api-core/google/api_core/gapic_v1/client_utils.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,14 @@ def should_use_mtls_endpoint(client_cert_available: bool) -> bool:
7777
otherwise falls back to evaluation of GOOGLE_API_USE_MTLS_ENDPOINT.
7878
"""
7979
if hasattr(google.auth.transport.mtls, "should_use_mtls_endpoint"):
80-
return google.auth.transport.mtls.should_use_mtls_endpoint(client_cert_available)
80+
return google.auth.transport.mtls.should_use_mtls_endpoint(
81+
client_cert_available
82+
)
8183

8284
# Fallback logic for older google-auth versions
83-
use_mtls_endpoint = os.getenv("GOOGLE_API_USE_MTLS_ENDPOINT", "auto").strip().lower()
85+
use_mtls_endpoint = (
86+
os.getenv("GOOGLE_API_USE_MTLS_ENDPOINT", "auto").strip().lower()
87+
)
8488
if use_mtls_endpoint == "always":
8589
return True
8690
elif use_mtls_endpoint == "never":

packages/google-api-core/tests/unit/gapic/test_client_utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,9 @@ def test_get_api_endpoint(
193193
default_endpoint_template,
194194
expected,
195195
):
196-
with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": use_mtls_endpoint}):
196+
with mock.patch.dict(
197+
os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": use_mtls_endpoint}
198+
):
197199
if isinstance(expected, type) and issubclass(expected, Exception):
198200
with pytest.raises(expected):
199201
get_api_endpoint(

0 commit comments

Comments
 (0)