MCPcopy
hub / github.com/encode/httpx / test_basic_auth_in_url

Function test_basic_auth_in_url

tests/client/test_auth.py:195–203  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

193
194@pytest.mark.anyio
195async def test_basic_auth_in_url() -> None:
196 url = "https://user:password123@example.org/"
197 app = App()
198
199 async with httpx.AsyncClient(transport=httpx.MockTransport(app)) as client:
200 response = await client.get(url)
201
202 assert response.status_code == 200
203 assert response.json() == {"auth": "Basic dXNlcjpwYXNzd29yZDEyMw=="}
204
205
206@pytest.mark.anyio

Callers

nothing calls this directly

Calls 3

AppClass · 0.85
jsonMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected