Skip to content

Commit b6dd262

Browse files
committed
fmt + fix linting errors
1 parent a27a793 commit b6dd262

File tree

3 files changed

+12
-15
lines changed

3 files changed

+12
-15
lines changed

client/transport/sse_test.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -525,9 +525,7 @@ func TestSSE(t *testing.T) {
525525
t.Fatalf("SendRequest failed: %v", err)
526526
}
527527

528-
if response == nil {
529-
t.Fatal("Expected response, got nil")
530-
}
528+
require.NotNil(t, response, "Expected response, got nil")
531529

532530
// Verify the response
533531
var result string

client/transport/streamable_http_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"time"
1414

1515
"github.com/mark3labs/mcp-go/mcp"
16+
"github.com/stretchr/testify/require"
1617
)
1718

1819
// startMockStreamableHTTPServer starts a test HTTP server that implements
@@ -535,9 +536,7 @@ func TestStreamableHTTP(t *testing.T) {
535536
t.Fatalf("SendRequest failed: %v", err)
536537
}
537538

538-
if response == nil {
539-
t.Fatal("Expected response, got nil")
540-
}
539+
require.NotNil(t, response, "Expected response, got nil")
541540

542541
// Verify the response
543542
var result string

server/streamable_http_client_info_test.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,49 +12,49 @@ func TestStreamableHttpSessionImplementsSessionWithClientInfo(t *testing.T) {
1212
resourceStore := newSessionResourcesStore()
1313
templatesStore := newSessionResourceTemplatesStore()
1414
logStore := newSessionLogLevelsStore()
15-
15+
1616
// Create a streamable HTTP session
1717
session := newStreamableHttpSession("test-session", toolStore, resourceStore, templatesStore, logStore)
18-
18+
1919
// Verify it implements SessionWithClientInfo
2020
var clientSession ClientSession = session
2121
clientInfoSession, ok := clientSession.(SessionWithClientInfo)
2222
if !ok {
2323
t.Fatal("streamableHttpSession should implement SessionWithClientInfo")
2424
}
25-
25+
2626
// Test GetClientInfo with no data set (should return empty)
2727
clientInfo := clientInfoSession.GetClientInfo()
2828
if clientInfo.Name != "" || clientInfo.Version != "" {
2929
t.Errorf("expected empty client info, got %+v", clientInfo)
3030
}
31-
31+
3232
// Test SetClientInfo and GetClientInfo
3333
expectedClientInfo := mcp.Implementation{
3434
Name: "test-client",
3535
Version: "1.0.0",
3636
}
3737
clientInfoSession.SetClientInfo(expectedClientInfo)
38-
38+
3939
actualClientInfo := clientInfoSession.GetClientInfo()
4040
if actualClientInfo.Name != expectedClientInfo.Name || actualClientInfo.Version != expectedClientInfo.Version {
4141
t.Errorf("expected client info %+v, got %+v", expectedClientInfo, actualClientInfo)
4242
}
43-
43+
4444
// Test GetClientCapabilities with no data set (should return empty)
4545
capabilities := clientInfoSession.GetClientCapabilities()
4646
if capabilities.Sampling != nil || capabilities.Roots != nil {
4747
t.Errorf("expected empty client capabilities, got %+v", capabilities)
4848
}
49-
49+
5050
// Test SetClientCapabilities and GetClientCapabilities
5151
expectedCapabilities := mcp.ClientCapabilities{
5252
Sampling: &struct{}{},
5353
}
5454
clientInfoSession.SetClientCapabilities(expectedCapabilities)
55-
55+
5656
actualCapabilities := clientInfoSession.GetClientCapabilities()
5757
if actualCapabilities.Sampling == nil {
5858
t.Errorf("expected sampling capability to be set")
5959
}
60-
}
60+
}

0 commit comments

Comments
 (0)