()
| 12 | |
| 13 | |
| 14 | def test_basic_auth(): |
| 15 | auth = httpx.BasicAuth(username="user", password="pass") |
| 16 | request = httpx.Request("GET", "https://www.example.com") |
| 17 | |
| 18 | # The initial request should include a basic auth header. |
| 19 | flow = auth.sync_auth_flow(request) |
| 20 | request = next(flow) |
| 21 | assert request.headers["Authorization"].startswith("Basic") |
| 22 | |
| 23 | # No other requests are made. |
| 24 | response = httpx.Response(content=b"Hello, world!", status_code=200) |
| 25 | with pytest.raises(StopIteration): |
| 26 | flow.send(response) |
| 27 | |
| 28 | |
| 29 | def test_digest_auth_with_200(): |
nothing calls this directly
no test coverage detected