dunemcptest

package
v0.1.22 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: MIT Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package dunemcptest provides a fake Dune MCP server for command tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRoot

func NewRoot(cmd *cobra.Command, fake *Fake) (*cobra.Command, *bytes.Buffer)

NewRoot returns a root command holding cmd, with fake as its Dune MCP server, and the buffer that collects its output.

Types

type Call

type Call struct {
	Tool string
	Args string
}

Call is one recorded tool call, with its arguments as they go on the wire.

type Fake

type Fake struct {
	// Results maps a tool name to the JSON result it returns.
	Results map[string]string
	// Errors maps a tool name to the error it returns.
	Errors map[string]error
	Calls  []Call
}

Fake is a dunemcp.Caller that returns canned tool results and records calls.

func (*Fake) Call

func (f *Fake) Call(_ context.Context, tool string, args map[string]any) (json.RawMessage, error)

Call implements dunemcp.Caller.

func (*Fake) Last

func (f *Fake) Last() Call

Last returns the most recent call. It panics when there was none.

Jump to

Keyboard shortcuts

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