testutil

package
v1.0.74 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2026 License: MIT Imports: 6 Imported by: 0 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 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