Documentation
¶
Overview ¶
Package testutil provides shared testing utilities for MCP server tests.
Index ¶
- func CheckMessage(t *testing.T, message mcp.JSONRPCMessage)
- func DeskClientMock(status int, response []byte) (*deskclient.Client, *httptest.Server)
- func DeskMCPServerMock(t *testing.T, status int, response []byte) (*server.MCPServer, func())
- func ExecuteToolRequest(t *testing.T, mcpServer *server.MCPServer, toolName string, ...)
- func ProjectsEngineMock(status int, response []byte) *twapi.Engine
- func ProjectsMCPServerMock(t *testing.T, status int, response []byte) *server.MCPServer
- type ProjectsSessionMock
- type ToolRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckMessage ¶
func CheckMessage(t *testing.T, message mcp.JSONRPCMessage)
CheckMessage validates that a message represents a successful tool execution
func DeskClientMock ¶
DeskClientMock creates a mock desk client with a test server
func DeskMCPServerMock ¶
DeskMCPServerMock creates a mock MCP server for twdesk testing
func ExecuteToolRequest ¶
func ExecuteToolRequest(t *testing.T, mcpServer *server.MCPServer, toolName string, args map[string]any)
ExecuteToolRequest executes a tool request and validates the response
func ProjectsEngineMock ¶
ProjectsEngineMock creates a mock twapi.Engine with the given HTTP response
Types ¶
type ProjectsSessionMock ¶
type ProjectsSessionMock struct{}
ProjectsSessionMock implements a mock session for twprojects testing
func (ProjectsSessionMock) Authenticate ¶
Authenticate implements the Authenticate method for ProjectsSessionMock
func (ProjectsSessionMock) Server ¶
func (s ProjectsSessionMock) Server() string
Server implements the Server method for ProjectsSessionMock
type ToolRequest ¶
type ToolRequest struct {
mcp.CallToolRequest
JSONRPC string `json:"jsonrpc"`
ID int64 `json:"id"`
}
ToolRequest represents a tool request for testing