()
| 27 | |
| 28 | |
| 29 | def test_digest_auth_with_200(): |
| 30 | auth = httpx.DigestAuth(username="user", password="pass") |
| 31 | request = httpx.Request("GET", "https://www.example.com") |
| 32 | |
| 33 | # The initial request should not include an auth header. |
| 34 | flow = auth.sync_auth_flow(request) |
| 35 | request = next(flow) |
| 36 | assert "Authorization" not in request.headers |
| 37 | |
| 38 | # If a 200 response is returned, then no other requests are made. |
| 39 | response = httpx.Response(content=b"Hello, world!", status_code=200) |
| 40 | with pytest.raises(StopIteration): |
| 41 | flow.send(response) |
| 42 | |
| 43 | |
| 44 | def test_digest_auth_with_401(): |
nothing calls this directly
no test coverage detected