🎨 清理多余文件,修改项目model
This commit is contained in:
@@ -4,19 +4,29 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/mark3labs/mcp-go/mcp"
|
||||
"os"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func requireMCPIntegration(t *testing.T) {
|
||||
t.Helper()
|
||||
if os.Getenv("RUN_MCP_INTEGRATION") == "" {
|
||||
t.Skip("set RUN_MCP_INTEGRATION=1 to run MCP integration tests")
|
||||
}
|
||||
}
|
||||
|
||||
// 测试 MCP 客户端连接
|
||||
func TestMcpClientConnection(t *testing.T) {
|
||||
requireMCPIntegration(t)
|
||||
c, err := NewClient("http://localhost:8888/sse", "test-client", "1.0.0", "gin-vue-admin MCP服务")
|
||||
defer c.Close()
|
||||
if err != nil {
|
||||
t.Fatalf(err.Error())
|
||||
t.Fatalf("create client failed: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestTools(t *testing.T) {
|
||||
requireMCPIntegration(t)
|
||||
t.Run("currentTime", func(t *testing.T) {
|
||||
c, err := NewClient("http://localhost:8888/sse", "test-client", "1.0.0", "gin-vue-admin MCP服务")
|
||||
defer c.Close()
|
||||
@@ -91,6 +101,7 @@ func TestTools(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestGetTools(t *testing.T) {
|
||||
requireMCPIntegration(t)
|
||||
c, err := NewClient("http://localhost:8888/sse", "test-client", "1.0.0", "gin-vue-admin MCP服务")
|
||||
defer c.Close()
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user