(t *testing.T)
| 8 | ) |
| 9 | |
| 10 | func TestGetToolScopeMap(t *testing.T) { |
| 11 | // Reset and set up a test map |
| 12 | SetGlobalToolScopeMap(ToolScopeMap{ |
| 13 | "test_tool": &ToolScopeInfo{ |
| 14 | RequiredScopes: []string{"read:org"}, |
| 15 | AcceptedScopes: []string{"read:org", "write:org", "admin:org"}, |
| 16 | }, |
| 17 | }) |
| 18 | |
| 19 | m, err := GetToolScopeMap() |
| 20 | require.NoError(t, err) |
| 21 | require.NotNil(t, m) |
| 22 | require.Greater(t, len(m), 0, "expected at least one tool in the scope map") |
| 23 | |
| 24 | testTool, ok := m["test_tool"] |
| 25 | require.True(t, ok, "expected test_tool to be in the scope map") |
| 26 | assert.Contains(t, testTool.RequiredScopes, "read:org") |
| 27 | assert.Contains(t, testTool.AcceptedScopes, "read:org") |
| 28 | assert.Contains(t, testTool.AcceptedScopes, "admin:org") |
| 29 | } |
| 30 | |
| 31 | func TestGetToolScopeInfo(t *testing.T) { |
| 32 | // Set up test scope map |
nothing calls this directly
no test coverage detected