foxytest

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2024 License: MIT Imports: 13 Imported by: 0

README

foxytest

foxytest is a Golang package that provides a simple way to test your MCP Servers.

Read more about it in the documentation.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StdRunner added in v0.0.11

type StdRunner struct {
	// contains filtered or unexported fields
}

func NewTestRunner

func NewTestRunner(t *testing.T) *StdRunner

func (*StdRunner) Errorf added in v0.0.11

func (tc *StdRunner) Errorf(format string, args ...interface{})

func (*StdRunner) Fatal added in v0.0.11

func (tc *StdRunner) Fatal(args ...interface{})

func (*StdRunner) Fatalf added in v0.0.11

func (tc *StdRunner) Fatalf(format string, args ...interface{})

func (*StdRunner) Log added in v0.0.11

func (tc *StdRunner) Log(args ...interface{})

func (*StdRunner) Logf added in v0.0.11

func (tc *StdRunner) Logf(format string, args ...interface{})

func (*StdRunner) Run added in v0.0.11

func (tc *StdRunner) Run(name string, f func(t TestRunner)) bool

type Test

type Test interface {
	Run(t TestRunner)
	SetLogging(bool)
	GetTestCases() []TestCase
}

type TestCase

type TestCase interface {
	GetName() string
	GetInputs() []map[string]interface{}
	GetOutputs() []map[string]interface{}
}

type TestRunner

type TestRunner interface {
	TestSystem
	Run(name string, f func(t TestRunner)) bool
}

TestRunner is an interface that is compatible with the testing.T interface , so that the test suite can be run with the standard go test runner or with any other runner that implements this interface, particularly it is used by `mst` command line runner allowing to use this test suite runner from languages other than Go

type TestSuite

type TestSuite interface {
	WithBeforeAll(func() error) TestSuite
	WithAfterAll(func() error) TestSuite
	WithBeforeEach(func() error) TestSuite
	WithAfterEach(func() error) TestSuite
	WithLogging() TestSuite

	WithExecutable(command string, args []string) TestSuite

	Run(t TestRunner)
	Errors() []error
	AssertNoErrors(t TestRunner)
	GetTests() []Test
}

TestSuite represents a collection of tests that can be run together

func Read

func Read(path string) (TestSuite, error)

Read would read a collection of tests from a folder specified by path

type TestSystem added in v0.0.11

type TestSystem interface {
	Fatal(args ...interface{})
	Fatalf(format string, args ...interface{})
	Errorf(format string, args ...interface{})
	Log(args ...interface{})
	Logf(format string, args ...interface{})
}

Directories

Path Synopsis
Package testrunner_mock is a generated GoMock package.
Package testrunner_mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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