testutil

package
v1.0.21 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package testutil holds test-only helpers shared across event subsystem tests.

Index

Constants

This section is empty.

Variables

View Source
var ErrStubUnconfigured = errors.New("testutil.StubAPIClient: no body or err configured")

Functions

This section is empty.

Types

type FakeTransport

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

FakeTransport delegates to inner with a fixed addr, so tests can use t.TempDir paths.

func NewWrappedFake

func NewWrappedFake(inner transport.IPC, addr string) *FakeTransport

func (*FakeTransport) Address

func (t *FakeTransport) Address(_ string) string

func (*FakeTransport) Cleanup

func (t *FakeTransport) Cleanup(_ string)

func (*FakeTransport) CleanupCount

func (t *FakeTransport) CleanupCount() int

func (*FakeTransport) Dial

func (t *FakeTransport) Dial(_ string) (net.Conn, error)

func (*FakeTransport) DidCleanup

func (t *FakeTransport) DidCleanup() bool

func (*FakeTransport) Listen

func (t *FakeTransport) Listen(_ string) (net.Listener, error)

type StubAPIClient

type StubAPIClient struct {
	Body string
	Err  error

	GotMethod string
	GotPath   string
	GotBody   interface{}
	Calls     int
	// contains filtered or unexported fields
}

StubAPIClient records the last call and returns Body or Err.

func (*StubAPIClient) CallAPI

func (s *StubAPIClient) CallAPI(_ context.Context, method, path string, body interface{}) (json.RawMessage, error)

Jump to

Keyboard shortcuts

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