testutils_test

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package testutils_test contains utility methods for unit tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CmdToMessage

func CmdToMessage(cmd tea.Cmd, messages *[]tea.Msg)

CmdToMessage - should only be used in unit tests.

Types

type MockStorage added in v1.5.0

type MockStorage struct {
	Hosts []host.Host
	// contains filtered or unexported fields
}

func NewMockStorage

func NewMockStorage(shouldFail bool) *MockStorage

NewMockStorage creates a new instance of MockStorage for unit tests. If shouldFail is true, then all operations like Get, Delete, Save will return an error.

func (*MockStorage) Close added in v1.5.0

func (ms *MockStorage) Close()

func (*MockStorage) Delete added in v1.5.0

func (ms *MockStorage) Delete(id int) error

Delete implements storage.HostStorage.

func (*MockStorage) Get added in v1.5.0

func (ms *MockStorage) Get(hostID int) (host.Host, error)

Get implements storage.HostStorage.

func (*MockStorage) GetAll added in v1.5.0

func (ms *MockStorage) GetAll() ([]host.Host, error)

GetAll implements storage.HostStorage.

func (*MockStorage) Save added in v1.5.0

func (ms *MockStorage) Save(m host.Host) (host.Host, error)

Save implements storage.HostStorage.

func (*MockStorage) Type added in v1.5.0

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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