Documentation
¶
Overview ¶
Package test provides testing utilities and assertions for the agent-standards-mcp server.
Index ¶
- func AssertGetStandardsContainsContent(t *testing.T, plainText string, ...)
- func AssertMultipleStandardsFormat(t *testing.T, plainText string)
- func AssertPlainTextInput(t *testing.T, result *mcp.CallToolResult) string
- func AssertStandardContainsContent(t *testing.T, plainText string, standardName, expectedContent string)
- func AssertStandardContainsDescription(t *testing.T, plainText string, standardName, expectedDescription string)
- func AssertStandardListContains(t *testing.T, plainText string, standardName string)
- func AssertStandardListCount(t *testing.T, plainText string, expectedCount int)
- func AssertToolCallError(t *testing.T, suite *Suite, toolName string, args map[string]any) *mcp.CallToolResult
- func AssertToolCallSuccess(t *testing.T, suite *Suite, toolName string, args map[string]any) *mcp.CallToolResult
- func AssertToolsAvailable(t *testing.T, suite *Suite, expectedTools []string)
- func CustomStandardFiles() map[string]string
- func DefaultStandardFiles() map[string]string
- func EmptyStandardFiles() map[string]string
- func NonExistentStandardFile() map[string]string
- type MCPTestServer
- type SetupOption
- type Suite
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertGetStandardsContainsContent ¶
func AssertGetStandardsContainsContent( t *testing.T, plainText string, standardName, expectedDescription, expectedContent string, )
AssertGetStandardsContainsContent validates that get_standards result contains full content for a standard
func AssertMultipleStandardsFormat ¶
AssertMultipleStandardsFormat validates that multiple standards are properly separated
func AssertPlainTextInput ¶
func AssertPlainTextInput(t *testing.T, result *mcp.CallToolResult) string
AssertPlainTextInput validates that the result contains plain text content
func AssertStandardContainsContent ¶
func AssertStandardContainsContent(t *testing.T, plainText string, standardName, expectedContent string)
AssertStandardContainsContent validates that a standard in plain text contains expected content
func AssertStandardContainsDescription ¶
func AssertStandardContainsDescription(t *testing.T, plainText string, standardName, expectedDescription string)
AssertStandardContainsDescription validates that a standard in plain text contains expected description
func AssertStandardListContains ¶
AssertStandardListContains validates that plain text contains a specific standard by name
func AssertStandardListCount ¶
AssertStandardListCount validates that plain text contains expected number of standards
func AssertToolCallError ¶
func AssertToolCallError(t *testing.T, suite *Suite, toolName string, args map[string]any) *mcp.CallToolResult
AssertToolCallError calls a tool and verifies it returns an error
func AssertToolCallSuccess ¶
func AssertToolCallSuccess(t *testing.T, suite *Suite, toolName string, args map[string]any) *mcp.CallToolResult
AssertToolCallSuccess calls a tool and verifies successful execution
func AssertToolsAvailable ¶
AssertToolsAvailable checks that the expected tools are available in server
func CustomStandardFiles ¶
CustomStandardFiles returns a custom set of standard files for specific tests
func DefaultStandardFiles ¶
DefaultStandardFiles returns the default set of test standard files
func EmptyStandardFiles ¶
EmptyStandardFiles returns an empty set of standard files
func NonExistentStandardFile ¶
NonExistentStandardFile returns a standard file for testing non-existent standards
Types ¶
type MCPTestServer ¶
type MCPTestServer struct {
Server *server.MCP
Config *config.Config
StandardLoader server.StandardLoader
}
MCPTestServer wraps the MCP server for testing
type SetupOption ¶
type SetupOption func(*setupConfig)
SetupOption defines configuration options for test suite
func WithClientInfo ¶
func WithClientInfo(name, version string) SetupOption
WithClientInfo configures the MCP client identification
func WithCommandTransport ¶
func WithCommandTransport() SetupOption
WithCommandTransport configures the setup to use command transport (real subprocess)
func WithCustomStandardFiles ¶
func WithCustomStandardFiles(files map[string]string) SetupOption
WithCustomStandardFiles configures custom standard files
type Suite ¶
type Suite struct {
Client *mcp.Client
ClientSession *mcp.ClientSession
Server *MCPTestServer
// contains filtered or unexported fields
}
Suite provides a complete MCP client-server setup for integration testing
func NewTestSuite ¶
func NewTestSuite(t *testing.T, opts ...SetupOption) *Suite
NewTestSuite creates a complete integration test environment