MCPcopy
hub / github.com/github/github-mcp-server / TestGetToolScopeInfo

Function TestGetToolScopeInfo

pkg/scopes/map_test.go:31–48  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

29}
30
31func TestGetToolScopeInfo(t *testing.T) {
32 // Set up test scope map
33 SetGlobalToolScopeMap(ToolScopeMap{
34 "search_orgs": &ToolScopeInfo{
35 RequiredScopes: []string{"read:org"},
36 AcceptedScopes: []string{"read:org", "write:org", "admin:org"},
37 },
38 })
39
40 info, err := GetToolScopeInfo("search_orgs")
41 require.NoError(t, err)
42 require.NotNil(t, info)
43
44 // Non-existent tool should return nil
45 info, err = GetToolScopeInfo("nonexistent_tool")
46 require.NoError(t, err)
47 assert.Nil(t, info)
48}
49
50func TestToolScopeInfo_HasAcceptedScope(t *testing.T) {
51 testCases := []struct {

Callers

nothing calls this directly

Calls 2

SetGlobalToolScopeMapFunction · 0.85
GetToolScopeInfoFunction · 0.85

Tested by

no test coverage detected