Initial curated ITWorx_MCP_Hub source from 368fba691ea8d23403b4d56b53b5ec670d7c5020
This commit is contained in:
commit
cb5be898ea
663 files changed
+82674
No files matched your search
@@ -0,0 +1,36 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from mcp.server.mcpserver import MCPServer
|
||||
|
||||
from services.runtime.mcp_server import WORKFLOW_PROMPTS, add_workflow_prompts
|
||||
|
||||
|
||||
def test_every_runtime_connector_has_useful_unique_workflow_prompts() -> None:
|
||||
all_names: list[str] = []
|
||||
for profile in ("knowledge", "gitea", "unraid", "mobilityops"):
|
||||
server = MCPServer(f"test-{profile}")
|
||||
add_workflow_prompts(server, profile)
|
||||
prompts = server._prompt_manager.list_prompts()
|
||||
assert len(prompts) == len(WORKFLOW_PROMPTS[profile])
|
||||
assert all(prompt.description and len(prompt.description) > 80 for prompt in prompts)
|
||||
all_names.extend(prompt.name for prompt in prompts)
|
||||
assert len(all_names) == len(set(all_names))
|
||||
|
||||
|
||||
def test_workflow_prompts_are_explicitly_read_only_and_evidence_driven() -> None:
|
||||
messages = " ".join(
|
||||
message for prompts in WORKFLOW_PROMPTS.values() for _name, _title, message in prompts
|
||||
).casefold()
|
||||
assert "read-only" in messages or "do not perform a write" in messages
|
||||
assert "evidence" in messages
|
||||
assert "cite" in messages or "citation" in messages
|
||||
|
||||
|
||||
def test_unknown_workflow_profile_fails_closed() -> None:
|
||||
server = MCPServer("unknown")
|
||||
try:
|
||||
add_workflow_prompts(server, "missing")
|
||||
except ValueError as exc:
|
||||
assert "unknown workflow" in str(exc)
|
||||
else:
|
||||
raise AssertionError("unknown workflow profile was accepted")
|
||||
Reference in new issue
Block a user