Documentation
¶
Overview ¶
Package socketbridgetest provides test utilities for the socketbridge package.
Index ¶
- type Call
- type MockManager
- func (m *MockManager) CallCount(method string) int
- func (m *MockManager) CalledWith(method, containerID string) bool
- func (m *MockManager) EnsureBridge(containerID string, gpgEnabled bool) error
- func (m *MockManager) IsRunning(containerID string) bool
- func (m *MockManager) Reset()
- func (m *MockManager) StopAll() error
- func (m *MockManager) StopBridge(containerID string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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) StopAll ¶
func (m *MockManager) StopAll() error
StopAll implements SocketBridgeManager.
func (*MockManager) StopBridge ¶
func (m *MockManager) StopBridge(containerID string) error
StopBridge implements SocketBridgeManager.