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

Function TestStripMetaKeys_MultipleKeys

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

Source from the content-addressed store, hash-verified

2020}
2021
2022func TestStripMetaKeys_MultipleKeys(t *testing.T) {
2023 // This test verifies the mechanism works for multiple keys
2024 keys := []string{"ui", "experimental_feature", "beta"}
2025
2026 tool := mockToolWithMeta("test", "toolset1", map[string]any{
2027 "ui": "ui data",
2028 "experimental_feature": "exp data",
2029 "beta": "beta data",
2030 "description": "kept",
2031 })
2032
2033 result := stripMetaKeys(tool, keys)
2034
2035 require.NotNil(t, result)
2036 require.NotNil(t, result.Tool.Meta)
2037 require.Nil(t, result.Tool.Meta["ui"], "ui should be stripped")
2038 require.Nil(t, result.Tool.Meta["experimental_feature"], "experimental_feature should be stripped")
2039 require.Nil(t, result.Tool.Meta["beta"], "beta should be stripped")
2040 require.Equal(t, "kept", result.Tool.Meta["description"], "description should be preserved")
2041}
2042
2043func TestWithMCPApps_DoesNotMutateOriginalTools(t *testing.T) {
2044 originalMeta := map[string]any{"ui": "data", "description": "kept"}

Callers

nothing calls this directly

Calls 2

mockToolWithMetaFunction · 0.85
stripMetaKeysFunction · 0.85

Tested by

no test coverage detected