Skip to content

Commit 761f0a7

Browse files
fix: Update registry fixture with AuthorizedSession mock
fix: Update registry fixture with AuthorizedSession mock
1 parent 72d1866 commit 761f0a7

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

tests/unittests/integrations/agent_registry/test_agent_registry.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,14 @@ class TestAgentRegistry:
4242
def registry(self):
4343
mock_creds = MagicMock()
4444
mock_creds.quota_project_id = None
45-
with patch("google.auth.default", return_value=(mock_creds, "project-id")):
46-
return AgentRegistry(project_id="test-project", location="global")
45+
with patch(
46+
"google.auth.default", return_value=(mock_creds, "project-id")
47+
), patch(
48+
"google.auth.transport.requests.AuthorizedSession"
49+
) as mock_session_class:
50+
registry = AgentRegistry(project_id="test-project", location="global")
51+
registry._mock_session = mock_session_class.return_value
52+
return registry
4753

4854
@pytest.mark.asyncio
4955
@patch("google.auth.transport.requests.AuthorizedSession")

0 commit comments

Comments
 (0)