| 148 | |
| 149 | @pytest.mark.anyio |
| 150 | async def test_asgi_headers(): |
| 151 | transport = httpx.ASGITransport(app=echo_headers) |
| 152 | async with httpx.AsyncClient(transport=transport) as client: |
| 153 | response = await client.get("http://www.example.org/") |
| 154 | |
| 155 | assert response.status_code == 200 |
| 156 | assert response.json() == { |
| 157 | "headers": [ |
| 158 | ["host", "www.example.org"], |
| 159 | ["accept", "*/*"], |
| 160 | ["accept-encoding", "gzip, deflate, br, zstd"], |
| 161 | ["connection", "keep-alive"], |
| 162 | ["user-agent", f"python-httpx/{httpx.__version__}"], |
| 163 | ] |
| 164 | } |
| 165 | |
| 166 | |
| 167 | @pytest.mark.anyio |