socketbridgetest

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package socketbridgetest provides test utilities for the socketbridge package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Call

type Call struct {
	Method string
	Args   []any
}

Call records a single method invocation.

type MockManager

type MockManager struct {
	EnsureBridgeFn func(containerID string, gpgEnabled bool) error
	StopBridgeFn   func(containerID string) error
	StopAllFn      func() error
	IsRunningFn    func(containerID string) bool

	// Call tracking
	Calls []Call
	// contains filtered or unexported fields
}

MockManager is a test mock for socketbridge.SocketBridgeManager. Each method delegates to a configurable function field. If the function field is nil, the method returns a zero value.

Call tracking records all invocations for assertion.

func NewMockManager

func NewMockManager() *MockManager

NewMockManager creates a new MockManager with no-op defaults.

func (*MockManager) CallCount

func (m *MockManager) CallCount(method string) int

CallCount returns the number of times the given method was called.

func (*MockManager) CalledWith

func (m *MockManager) CalledWith(method, containerID string) bool

CalledWith returns true if the given method was called with the given containerID as its first argument.

func (*MockManager) EnsureBridge

func (m *MockManager) EnsureBridge(containerID string, gpgEnabled bool) error

EnsureBridge implements SocketBridgeManager.

func (*MockManager) IsRunning

func (m *MockManager) IsRunning(containerID string) bool

IsRunning implements SocketBridgeManager.

func (*MockManager) Reset

func (m *MockManager) Reset()

Reset clears all recorded calls.

func (*MockManager) StopAll

func (m *MockManager) StopAll() error

StopAll implements SocketBridgeManager.

func (*MockManager) StopBridge

func (m *MockManager) StopBridge(containerID string) error

StopBridge implements SocketBridgeManager.

Jump to

Keyboard shortcuts

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