Skip to content

Commit 720a0c9

Browse files
fix: remove redundant testcase
Signed-off-by: Radhika Agrawal <agrawalradhika@google.com>
1 parent b6d5052 commit 720a0c9

File tree

1 file changed

+1
-28
lines changed

1 file changed

+1
-28
lines changed

tests/transport/test_mtls.py

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import pytest # type: ignore
1818

1919
from google.auth import exceptions
20+
from google.auth.transport import _mtls_helper
2021
from google.auth.transport import mtls
2122

2223

@@ -46,34 +47,6 @@ def side_effect(path):
4647
check_config_path.assert_called_with("path/to/cert.json")
4748

4849

49-
@mock.patch("google.auth.transport.mtls.getenv", autospec=True)
50-
@mock.patch("google.auth.transport._mtls_helper._check_config_path", autospec=True)
51-
def test_has_default_client_cert_source_config_path_success(
52-
check_config_path, mock_getenv
53-
):
54-
# 1. Mock getenv to return our custom path for the env var
55-
mock_getenv.side_effect = (
56-
lambda var: "path/to/cert.json"
57-
if var == "GOOGLE_API_CERTIFICATE_CONFIG"
58-
else None
59-
)
60-
61-
# 2. Configure side_effect to return None for default paths,
62-
# and a value ONLY for our custom path.
63-
def side_effect(path):
64-
if path == "path/to/cert.json":
65-
return "/absolute/path/to/cert.json"
66-
return None
67-
68-
check_config_path.side_effect = side_effect
69-
70-
# 3. Now the first two checks will return None, reaching the third check.
71-
assert mtls.has_default_client_cert_source()
72-
73-
# 4. Verify that the last call made was indeed with our env var path.
74-
check_config_path.assert_called_with("path/to/cert.json")
75-
76-
7750
@mock.patch("google.auth.transport.mtls.getenv", autospec=True)
7851
@mock.patch("google.auth.transport._mtls_helper._check_config_path", autospec=True)
7952
def test_has_default_client_cert_source_env_var_invalid_config_path(

0 commit comments

Comments
 (0)