Skip to content

Commit 3f84b57

Browse files
committed
added httpClient
1 parent f50bb51 commit 3f84b57

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tests/test_auth.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -952,7 +952,7 @@ def test_raise_from_response(self):
952952

953953
def test_validate_session_audience_auto_detection(self):
954954
"""Test that validate_session automatically detects audience when token audience matches project ID"""
955-
auth = Auth(self.dummy_project_id, self.public_key_dict)
955+
auth = Auth(self.dummy_project_id, self.public_key_dict, http_client=self.make_http_client())
956956

957957
with patch("jwt.get_unverified_header") as mock_get_header, patch("jwt.decode") as mock_decode:
958958
mock_get_header.return_value = {"alg": "ES384", "kid": self.public_key_dict["kid"]}
@@ -975,7 +975,7 @@ def test_validate_session_audience_auto_detection(self):
975975

976976
def test_validate_session_audience_auto_detection_list(self):
977977
"""Test that validate_session automatically detects audience when token audience is a list containing project ID"""
978-
auth = Auth(self.dummy_project_id, self.public_key_dict)
978+
auth = Auth(self.dummy_project_id, self.public_key_dict, http_client=self.make_http_client())
979979

980980
with patch("jwt.get_unverified_header") as mock_get_header, patch("jwt.decode") as mock_decode:
981981
mock_get_header.return_value = {"alg": "ES384", "kid": self.public_key_dict["kid"]}
@@ -994,7 +994,7 @@ def test_validate_session_audience_auto_detection_list(self):
994994

995995
def test_validate_session_audience_auto_detection_no_match(self):
996996
"""Test that validate_session does not auto-detect audience when token audience doesn't match project ID"""
997-
auth = Auth(self.dummy_project_id, self.public_key_dict)
997+
auth = Auth(self.dummy_project_id, self.public_key_dict, http_client=self.make_http_client())
998998

999999
with patch("jwt.get_unverified_header") as mock_get_header, patch("jwt.decode") as mock_decode:
10001000
mock_get_header.return_value = {"alg": "ES384", "kid": self.public_key_dict["kid"]}
@@ -1013,7 +1013,7 @@ def test_validate_session_audience_auto_detection_no_match(self):
10131013

10141014
def test_validate_session_explicit_audience(self):
10151015
"""Test that validate_session uses explicit audience parameter instead of auto-detection"""
1016-
auth = Auth(self.dummy_project_id, self.public_key_dict)
1016+
auth = Auth(self.dummy_project_id, self.public_key_dict, http_client=self.make_http_client())
10171017
explicit_audience = "explicit-audience"
10181018

10191019
with patch("jwt.get_unverified_header") as mock_get_header, patch("jwt.decode") as mock_decode:
@@ -1030,7 +1030,7 @@ def test_validate_session_explicit_audience(self):
10301030

10311031
def test_validate_and_refresh_session_audience_auto_detection(self):
10321032
"""Test that validate_and_refresh_session automatically detects audience when token audience matches project ID"""
1033-
auth = Auth(self.dummy_project_id, self.public_key_dict)
1033+
auth = Auth(self.dummy_project_id, self.public_key_dict, http_client=self.make_http_client())
10341034

10351035
with patch("jwt.get_unverified_header") as mock_get_header, patch("jwt.decode") as mock_decode:
10361036
mock_get_header.return_value = {"alg": "ES384", "kid": self.public_key_dict["kid"]}
@@ -1058,7 +1058,7 @@ def test_validate_and_refresh_session_audience_auto_detection(self):
10581058

10591059
def test_validate_session_audience_mismatch_fails(self):
10601060
"""Test that validate_session fails when token audience doesn't match project ID and no explicit audience is provided"""
1061-
auth = Auth(self.dummy_project_id, self.public_key_dict)
1061+
auth = Auth(self.dummy_project_id, self.public_key_dict, http_client=self.make_http_client())
10621062

10631063
with patch("jwt.get_unverified_header") as mock_get_header, patch("jwt.decode") as mock_decode:
10641064
mock_get_header.return_value = {"alg": "ES384", "kid": self.public_key_dict["kid"]}

0 commit comments

Comments
 (0)