@@ -108,24 +108,11 @@ async def test_init_strips_slashes(self, mock_httpx_client: AsyncMock):
108108 httpx_client = mock_httpx_client ,
109109 base_url = 'http://example.com/' ,
110110 agent_card_path = '/.well-known/agent.json/' ,
111- extended_agent_card_path = '/agent/authenticatedExtendedCard/' ,
112111 )
113112 assert resolver .base_url == 'http://example.com'
114113 assert (
115114 resolver .agent_card_path == '.well-known/agent.json/'
116115 ) # Path is only lstrip'd
117- assert resolver .extended_agent_card_path == 'agent/authenticatedExtendedCard/'
118-
119- resolver_no_leading_slash_path = A2ACardResolver (
120- httpx_client = AsyncMock (),
121- base_url = 'http://example.com' ,
122- agent_card_path = '.well-known/agent.json' ,
123- )
124- assert resolver_no_leading_slash_path .base_url == 'http://example.com'
125- assert (
126- resolver_no_leading_slash_path .agent_card_path
127- == '.well-known/agent.json'
128- )
129116
130117 @pytest .mark .asyncio
131118 async def test_get_agent_card_success_public_only (
@@ -168,17 +155,16 @@ async def test_get_agent_card_success_with_specified_path_for_extended_card(
168155 httpx_client = mock_httpx_client ,
169156 base_url = self .BASE_URL ,
170157 agent_card_path = self .AGENT_CARD_PATH ,
171- extended_agent_card_path = self .EXTENDED_AGENT_CARD_PATH .lstrip ('/' ),
172158 )
173159
174160 # Fetch the extended card by providing its relative path and example auth
175161 auth_kwargs = {"headers" : {"Authorization" : "Bearer testtoken" }}
176162 agent_card_result = await resolver .get_agent_card (
177- relative_card_path = resolver . extended_agent_card_path ,
163+ relative_card_path = self . EXTENDED_AGENT_CARD_PATH ,
178164 http_kwargs = auth_kwargs
179165 )
180166
181- expected_extended_url = f'{ self .BASE_URL } /{ resolver . extended_agent_card_path } '
167+ expected_extended_url = f'{ self .BASE_URL } /{ self . EXTENDED_AGENT_CARD_PATH . lstrip ( "/" ) } '
182168 mock_httpx_client .get .assert_called_once_with (expected_extended_url , ** auth_kwargs )
183169 extended_card_response .raise_for_status .assert_called_once ()
184170
0 commit comments