Skip to content

Commit 630eedb

Browse files
Josh Mabryclaude
andcommitted
test: mirror testkit's (prefix, router) convention in the fake registry
Verified register() against the real host loader + PluginRegistry: the module imports as a package (relative imports resolve), the factory returns None when disabled and a 17-tool stdio entry when enabled, and prefix="" mounts without tripping the server-side _prefix_conforms check. The real registry stores {"router", "prefix"} and a resolved Path; both host-free fakes simplify, so follow the sanctioned one in graph/plugins/testkit.py rather than inventing a third shape. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U69poCC3qyCbTnaJmRzBvi
1 parent d0d1bee commit 630eedb

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

tests/conftest.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,10 @@ def register_skill_dir(self, path) -> None:
5050
self.skill_dirs.append(path)
5151

5252
def register_router(self, router, prefix=None) -> None:
53-
self.routers.append((router, prefix))
53+
# (prefix, router) mirrors graph/plugins/testkit.py's convention. The real
54+
# registry stores {"router", "prefix"} and resolves the effective prefix;
55+
# the host-free fakes both simplify, so follow the sanctioned one.
56+
self.routers.append((prefix, router))
5457

5558
def register_tool(self, tool) -> None:
5659
self.tools.append(tool)

tests/test_register.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,9 @@ def test_the_skill_dir_exists(registered):
3333
def test_registers_the_test_route_at_the_convention_path(registered):
3434
"""`/api/config/test-<section>` is a fixed URL; prefix="" is the sanctioned
3535
escape hatch (the core chat-surface wirer uses the same one)."""
36-
_, prefix = registered.routers[0]
36+
prefix, router = registered.routers[0]
3737
assert prefix == ""
38-
paths = [r.path for r in registered.routers[0][0].routes]
39-
assert "/api/config/test-cua" in paths
38+
assert "/api/config/test-cua" in [r.path for r in router.routes]
4039

4140

4241
def test_registers_no_tools(registered):

0 commit comments

Comments
 (0)