mirror of
https://github.com/hansjone/netx.git
synced 2026-10-17 23:13:26 +08:00
Converge netx-topology MCP to dual-unit drain + orbit/polish mainline.
Trim public tools to 14, expose only kept layout actions/recipes, merge Fabric queries, drop createTopologyView/listTopologyViews, and align skill/docs with the live catalog. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
9bcb8ee0e3
commit
79f929de0c
86 changed files with 31578 additions and 240 deletions
36
packages/netx-topology-mcp/tests/test_move_nodes.py
Normal file
36
packages/netx-topology-mcp/tests/test_move_nodes.py
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
"""layoutTopologyView action=move_nodes registration + validation."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from netx_topology_mcp.http_tools import HTTP_MCP_TOOLS, _move_topology_view_nodes
|
||||
from netx_topology_mcp.layout_tool import list_layout_catalog
|
||||
|
||||
|
||||
def test_move_nodes_in_layout_schema_and_catalog() -> None:
|
||||
tool = next(t for t in HTTP_MCP_TOOLS if t["name"] == "layoutTopologyView")
|
||||
enum = tool["inputSchema"]["properties"]["action"]["enum"]
|
||||
assert "move_nodes" in enum
|
||||
assert "sink_nodes" in enum
|
||||
cat = list_layout_catalog()
|
||||
assert "move_nodes" in cat["actions"]
|
||||
assert "sink_nodes" in cat["actions"]
|
||||
|
||||
|
||||
def test_move_nodes_requires_ids_and_views() -> None:
|
||||
assert _move_topology_view_nodes({}).get("error") == "view_id_and_source_view_id_required"
|
||||
assert (
|
||||
_move_topology_view_nodes(
|
||||
{
|
||||
"view_id": "a",
|
||||
"source_view_id": "a",
|
||||
"params": {"fabric_node_ids": ["x"]},
|
||||
}
|
||||
).get("error")
|
||||
== "source_and_dest_must_differ"
|
||||
)
|
||||
assert (
|
||||
_move_topology_view_nodes(
|
||||
{"view_id": "a", "source_view_id": "b", "params": {}}
|
||||
).get("error")
|
||||
== "fabric_node_ids_required"
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue