Publish curated ITWorx_MCP_Hub source from 0e2f0e88b0359a4ed82515b4b04c0f80069e5e0a

This commit is contained in:
Public Source Publisher committed 2026-10-14 02:20:23 +00:00
1 parent 89703431af
commit 99caf1f968
3 files changed
+28 -4

No files matched your search

+24
View File
@@ -18,6 +18,30 @@ ROOT = Path(__file__).resolve().parents[1]
SCRIPT = ROOT / "scripts" / "build_mcp_hub_release_images.py"
def test_protected_metadata_uses_fixed_https_without_redirecting_credentials(monkeypatch):
class Opener:
def open(self, request, timeout):
assert request.full_url == (
"https://gitea.example.com/api/v1/repos/jens/itworx_mcp_hub/actions/runs/123"
)
assert request.get_header("Authorization") == "token fixture-token"
assert timeout == 20
return io.BytesIO(b'{"id":123}')
def build_opener(*handlers):
assert handlers[0].proxies == {}
assert (
handlers[1].redirect_request(None, None, 302, "redirect", {}, "https://other.test")
is None
)
return Opener()
monkeypatch.setattr(producer.urllib.request, "build_opener", build_opener)
assert producer._api_json("fixture-token", "/repos/jens/itworx_mcp_hub/actions/runs/123") == {
"id": 123
}
def _write_archive_fixture(path: Path, members: dict[str, bytes | None]) -> None:
with tarfile.open(path, "w:", format=tarfile.USTAR_FORMAT) as archive:
for name, payload in members.items():