MCPcopy Index your code
hub / github.com/github/github-mcp-server / TestWithDeprecatedAliases

Function TestWithDeprecatedAliases

pkg/inventory/registry_test.go:466–484  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

464}
465
466func TestWithDeprecatedAliases(t *testing.T) {
467 tools := []ServerTool{
468 mockTool("new_name", "toolset1", true),
469 }
470
471 reg := mustBuild(t, NewBuilder().SetTools(tools).WithDeprecatedAliases(map[string]string{
472 "old_name": "new_name",
473 "get_issue": "issue_read",
474 }))
475
476 // Test resolving aliases
477 resolved, aliasesUsed := reg.ResolveToolAliases([]string{"old_name"})
478 if len(resolved) != 1 || resolved[0] != "new_name" {
479 t.Errorf("expected alias to resolve to 'new_name', got %v", resolved)
480 }
481 if len(aliasesUsed) != 1 || aliasesUsed["old_name"] != "new_name" {
482 t.Errorf("expected alias mapping, got %v", aliasesUsed)
483 }
484}
485
486func TestResolveToolAliases(t *testing.T) {
487 tools := []ServerTool{

Callers

nothing calls this directly

Calls 6

mustBuildFunction · 0.85
NewBuilderFunction · 0.85
WithDeprecatedAliasesMethod · 0.80
SetToolsMethod · 0.80
ResolveToolAliasesMethod · 0.80
mockToolFunction · 0.70

Tested by

no test coverage detected