MCPcopy
hub / github.com/opentrace/opentrace / test_resolve_http_404

Function test_resolve_http_404

agent/tests/opentrace_agent/cli/test_auth.py:139–150  ·  view source on GitHub ↗
(tmp_path: Path, monkeypatch: object)

Source from the content-addressed store, hash-verified

137
138
139def 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# ---------------------------------------------------------------------------

Callers

nothing calls this directly

Calls 3

save_tokensFunction · 0.90
objectMethod · 0.80
_patch_base_dirFunction · 0.70

Tested by

no test coverage detected