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) DidCleanup ¶
func (t *FakeTransport) DidCleanup() bool
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)
Click to show internal directories.
Click to hide internal directories.