Skip to content

Commit a92b77b

Browse files
committed
clean up TestInventoryFiltersForRequest
1 parent 53dfd4c commit a92b77b

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

pkg/http/handler_test.go

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"testing"
88

99
ghcontext "github.com/github/github-mcp-server/pkg/context"
10-
"github.com/github/github-mcp-server/pkg/http/headers"
1110
"github.com/github/github-mcp-server/pkg/inventory"
1211
"github.com/modelcontextprotocol/go-sdk/mcp"
1312
"github.com/stretchr/testify/assert"
@@ -38,7 +37,6 @@ func TestInventoryFiltersForRequest(t *testing.T) {
3837
tests := []struct {
3938
name string
4039
contextSetup func(context.Context) context.Context
41-
headers map[string]string
4240
expectedTools []string
4341
}{
4442
{
@@ -61,14 +59,11 @@ func TestInventoryFiltersForRequest(t *testing.T) {
6159
expectedTools: []string{"get_file_contents", "create_repository"},
6260
},
6361
{
64-
name: "context toolset takes precedence over header",
62+
name: "tools alone clears default toolsets",
6563
contextSetup: func(ctx context.Context) context.Context {
66-
return ghcontext.WithToolsets(ctx, []string{"repos"})
67-
},
68-
headers: map[string]string{
69-
headers.MCPToolsetsHeader: "issues",
64+
return ghcontext.WithTools(ctx, []string{"list_issues"})
7065
},
71-
expectedTools: []string{"get_file_contents", "create_repository"},
66+
expectedTools: []string{"list_issues"},
7267
},
7368
{
7469
name: "tools are additive with toolsets",
@@ -84,9 +79,6 @@ func TestInventoryFiltersForRequest(t *testing.T) {
8479
for _, tt := range tests {
8580
t.Run(tt.name, func(t *testing.T) {
8681
req := httptest.NewRequest(http.MethodGet, "/", nil)
87-
for k, v := range tt.headers {
88-
req.Header.Set(k, v)
89-
}
9082
req = req.WithContext(tt.contextSetup(req.Context()))
9183

9284
builder := inventory.NewBuilder().

0 commit comments

Comments
 (0)