testhelper

package
v0.0.0-...-9b4757f Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2025 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package testhelper provides helpers to ease mocking functions and methods provided by packages such as os or http.

Index

Constants

View Source
const DefaultTmpDir = "/var/tmp"

Variables

This section is empty.

Functions

func NewOSMock

func NewOSMock(conf *OSMockConf) *osMock

func SaveCWD

func SaveCWD() func()

SaveCWD gets the current working directory and returns a function to go back to it nolint: errcheck

Types

type OSMockConf

type OSMockConf struct {
	OsutilCopySpecialFileThreshold uint
	ReadDirThreshold               uint
	RemoveThreshold                uint
	RemoveAllThreshold             uint
	TruncateThreshold              uint
	OpenFileThreshold              uint
	MkdirAllThreshold              uint
	HTTPGetThreshold               uint
	ReadAllThreshold               uint
}

OSMockConf enables setting thresholds to indicate how many calls a the mocked functions should accept before returning an error. See osMock methods for specific behaviors.

type PartitionTable

type PartitionTable struct {
	Label      string
	ID         string
	Device     string
	Unit       string
	FirstLBA   uint64
	LastLBA    uint64
	SectorSize uint64
	Partitions []SfDiskPartitions
}

type SfDiskPartitions

type SfDiskPartitions struct {
	Node  string
	Start uint64
	Size  uint64
	Type  string
	UUID  string
	Name  string
}

type SfdiskOutput

type SfdiskOutput struct {
	PartitionTable PartitionTable
}

Jump to

Keyboard shortcuts

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