()
| 161 | |
| 162 | @pytest.mark.anyio |
| 163 | async def test_basic_auth() -> None: |
| 164 | url = "https://example.org/" |
| 165 | auth = ("user", "password123") |
| 166 | app = App() |
| 167 | |
| 168 | async with httpx.AsyncClient(transport=httpx.MockTransport(app)) as client: |
| 169 | response = await client.get(url, auth=auth) |
| 170 | |
| 171 | assert response.status_code == 200 |
| 172 | assert response.json() == {"auth": "Basic dXNlcjpwYXNzd29yZDEyMw=="} |
| 173 | |
| 174 | |
| 175 | @pytest.mark.anyio |