test

package
v1.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 18, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package test provides integration testing helper functions for ophis It assumes ophis.Command is a root level subcommand

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CmdPathsToToolNames

func CmdPathsToToolNames(paths []string) []string

CmdPathsToToolNames converts command names with spaces to tool names with underscores

func GetInputSchema

func GetInputSchema(t *testing.T, tool *mcp.Tool) *jsonschema.Schema

GetInputSchema extracts and returns the input schema from a tool

func GetTools

func GetTools(t *testing.T, cmd *cobra.Command) []*mcp.Tool

GetTools runs `mcp tools` command and returns the parsed list of tools. It assumes the ophis command uses the default name "mcp". For custom command names, use GetToolsForCommand.

func GetToolsForCommand added in v1.1.3

func GetToolsForCommand(t *testing.T, cmd *cobra.Command, commandName string) []*mcp.Tool

GetToolsForCommand runs `<commandName> tools` and returns the parsed list of tools. commandName is the Use name of the ophis command in the Cobra tree (e.g. "mcp" or "agent").

func ToolNames

func ToolNames(t *testing.T, tools []*mcp.Tool, expectedNames ...string)

ToolNames checks that the provided tools match the expectedNames

func Tools

func Tools(t *testing.T, cmd *cobra.Command, expectedNames ...string)

Tools runs `mcp tools` and checks the output tool names against expectedNames. It assumes the ophis command uses the default name "mcp". For custom command names, use ToolsForCommand.

func ToolsForCommand added in v1.1.3

func ToolsForCommand(t *testing.T, cmd *cobra.Command, commandName string, expectedNames ...string)

ToolsForCommand runs `<commandName> tools` and checks the output tool names against expectedNames. commandName is the Use name of the ophis command in the Cobra tree.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL