(tmp_path: Path, monkeypatch: object)
| 137 | |
| 138 | |
| 139 | def test_resolve_http_404(tmp_path: Path, monkeypatch: object) -> None: |
| 140 | _patch_base_dir(monkeypatch, tmp_path) |
| 141 | save_tokens({"access_token": "otuat_valid"}) |
| 142 | monkeypatch.setattr(auth, "_discovery_cache", None) |
| 143 | |
| 144 | err = urllib.error.HTTPError("url", 404, "Not Found", {}, BytesIO(b"not found")) |
| 145 | with ( |
| 146 | patch.object(auth, "discover", return_value=FAKE_DISCOVERY), |
| 147 | patch("urllib.request.urlopen", side_effect=err), |
| 148 | ): |
| 149 | with pytest.raises(RuntimeError, match="not found"): |
| 150 | auth.resolve_org_token("org_x") |
| 151 | |
| 152 | |
| 153 | # --------------------------------------------------------------------------- |
nothing calls this directly
no test coverage detected