testhelper

package
v0.0.0-...-2202fe9 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 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
	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.

Jump to

Keyboard shortcuts

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