Publish curated ITWorx_MCP_Hub source from 6c7434368ce2a594005983c5a6601a31a639e7f1

This commit is contained in:
Public Source Publisher committed 2026-10-01 18:03:00 +00:00
1 parent 77946d62c4
commit 6d40ab975c
86 files changed
+6784 -1478

No files matched your search

+37
View File
@@ -0,0 +1,37 @@
"""The browser harness supplies every real web readiness dependency offline."""
from unittest.mock import patch
from fastapi.testclient import TestClient
from tests.e2e.harness import run_web, worker_readiness_fixture
def test_worker_fixture_is_explicit_and_read_only() -> None:
with TestClient(worker_readiness_fixture()) as client:
response = client.get("/health/ready")
assert response.status_code == 200
assert response.json() == {"status": "ready", "component": "e2e-worker-fixture"}
assert client.post("/health/ready").status_code == 405
def test_web_harness_configures_both_upstream_dependencies(tmp_path) -> None:
(tmp_path / "index.html").write_text("<html></html>", encoding="utf-8")
with (
patch("tests.e2e.harness.os.environ", {}),
patch("tests.e2e.harness.web_runtime.build_app") as build,
patch("tests.e2e.harness.generate_local_tls_material") as tls,
patch("tests.e2e.harness.uvicorn.run") as serve,
):
import os
def inspect_dependencies():
assert os.environ["HUB_CONTROL_URL"] == "http://127.0.0.1:8781"
assert os.environ["HUB_WORKER_URL"] == "http://127.0.0.1:8783"
return "configured-app"
build.side_effect = inspect_dependencies
tls.return_value.cert_path = tmp_path / "cert.pem"
tls.return_value.key_path = tmp_path / "key.pem"
run_web(8780, 8781, 8783, tmp_path)
assert serve.call_args.args == ("configured-app",)