MCPcopy Create free account
hub / github.com/github/gh-aw / TestComputeMCPToolsDiff_RemovedTools

Function TestComputeMCPToolsDiff_RemovedTools

pkg/cli/audit_diff_test.go:408–428  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

406}
407
408func TestComputeMCPToolsDiff_RemovedTools(t *testing.T) {
409 run1 := &MCPToolUsageData{
410 Summary: []MCPToolSummary{
411 {ServerName: "github", ToolName: "issue_read", CallCount: 10, ErrorCount: 0},
412 {ServerName: "github", ToolName: "search_repos", CallCount: 4, ErrorCount: 0},
413 },
414 }
415 run2 := &MCPToolUsageData{
416 Summary: []MCPToolSummary{
417 {ServerName: "github", ToolName: "issue_read", CallCount: 8, ErrorCount: 0},
418 },
419 }
420
421 diff := computeMCPToolsDiff(run1, run2)
422
423 assert.Len(t, diff.RemovedTools, 1, "Should have 1 removed tool")
424 assert.Equal(t, "search_repos", diff.RemovedTools[0].ToolName, "Removed tool should be search_repos")
425 assert.Equal(t, "removed", diff.RemovedTools[0].Status, "Status should be 'removed'")
426 assert.Equal(t, 4, diff.RemovedTools[0].Run1CallCount, "Should preserve run1 call count")
427 assert.Equal(t, 1, diff.Summary.RemovedToolCount, "Summary should show 1 removed tool")
428}
429
430func TestComputeMCPToolsDiff_ChangedTools(t *testing.T) {
431 run1 := &MCPToolUsageData{

Callers

nothing calls this directly

Calls 1

computeMCPToolsDiffFunction · 0.85

Tested by

no test coverage detected