Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions cmd/mcptools/commands/call_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,13 @@ func TestCallCmdRun_Tool(t *testing.T) {
}

func TestCallCmdRun_Resource(t *testing.T) {
t.Skip("Skipping resource command test as resources are not working as expected")

// Create a mock client that returns successful response
mockResponse := map[string]any{
"resources": []any{
"contents": []any{
map[string]any{
"uri": "test-resource",
"type": "text",
"description": "Test resource description",
"uri": "test://foo",
"mimeType": "text/plain",
"text": "bar",
},
},
}
Expand All @@ -90,14 +88,14 @@ func TestCallCmdRun_Resource(t *testing.T) {
cmd.SetOut(buf)

// Execute command with resource
cmd.SetArgs([]string{"resource:test-resource", "server", "arg"})
cmd.SetArgs([]string{"resource:test-resource", "-f", "json", "server", "arg"})
err := cmd.Execute()
if err != nil {
t.Errorf("cmd.Execute() error = %v", err)
}

// Verify output contains expected content
output := buf.String()
expectedOutput := "Resource content"
expectedOutput := `{"contents":[{"mimeType":"text/plain","text":"bar","uri":"test://foo"}]}`
assertContains(t, output, expectedOutput)
}