refs #732: add dynamic HMM HTML report MCP tool

This commit is contained in:
devmrko
2026-08-10 15:23:36 +09:00
parent cc2c3e3e25
commit c0c5a36ba0
12 changed files with 747 additions and 39 deletions

View File

@@ -123,6 +123,34 @@ class DemoScenarioConfigTest(unittest.TestCase):
server["tool_allowlist"],
)
def test_hmm_mcp_allows_dynamic_html_renderer(self) -> None:
root = Path(__file__).parents[1]
payload = json.loads(
(root / "config" / "mcp_servers.json").read_text(encoding="utf-8")
)
server = next(
item for item in payload["servers"] if item["id"] == "hmm_hr_mcp"
)
source = (root / "app.py").read_text(encoding="utf-8")
self.assertEqual(
server["endpoint_url"],
"https://hmm-backoffice.cloud-handson.com/mcp",
)
self.assertIn("render_hmm_carrier_report", server["tool_allowlist"])
self.assertNotIn('tool.name == "render_hmm_carrier_report"', source)
def test_hmm_report_template_contains_only_dynamic_payload_slot(self) -> None:
template = (
Path(__file__).parents[1]
/ "assets"
/ "hmm-carrier-performance-report.html"
).read_text(encoding="utf-8")
self.assertEqual(template.count("__REPORT_DATA__"), 1)
self.assertNotIn("Bluewave Maritime", template)
self.assertNotIn("Southern Cross Marine", template)
def test_hmm_demo_user_presets_reference_runtime_token_only(self) -> None:
path = Path(__file__).parents[1] / "config" / "vpd_token_presets.json"
payload = json.loads(path.read_text(encoding="utf-8"))