Skip to content

Commit b733fdd

Browse files
committed
mcp: fix test
Signed-off-by: Xie Zhihao <[email protected]>
1 parent 6c06aa3 commit b733fdd

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

mcp/streamable_client_test.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,11 @@ func TestStreamableClientGETHandling(t *testing.T) {
239239
}{
240240
{http.StatusOK, ""},
241241
{http.StatusMethodNotAllowed, ""},
242-
{http.StatusBadRequest, "standalone SSE"},
242+
// The client error status code is not treated as an error in non-strict
243+
// mode.
244+
{http.StatusNotFound, ""},
245+
{http.StatusBadRequest, ""},
246+
{http.StatusInternalServerError, "standalone SSE"},
243247
}
244248

245249
for _, test := range tests {
@@ -305,8 +309,11 @@ func TestStreamableClientStrictness(t *testing.T) {
305309
{"strict initialized", true, http.StatusOK, http.StatusMethodNotAllowed, true},
306310
{"unstrict initialized", false, http.StatusOK, http.StatusMethodNotAllowed, false},
307311
{"strict GET", true, http.StatusAccepted, http.StatusNotFound, true},
312+
// The client error status code is not treated as an error in non-strict
313+
// mode.
308314
{"unstrict GET on StatusNotFound", false, http.StatusOK, http.StatusNotFound, false},
309315
{"unstrict GET on StatusBadRequest", false, http.StatusOK, http.StatusBadRequest, false},
316+
{"GET on InternlServerError", false, http.StatusOK, http.StatusInternalServerError, true},
310317
}
311318
for _, test := range tests {
312319
t.Run(test.label, func(t *testing.T) {

0 commit comments

Comments
 (0)