testhelper

package
v0.0.0-...-4842e19 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 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

This section is empty.

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