Documentation
¶
Overview ¶
Package testutils contains several helpers and assertions for our unit, package or integration tests.
Index ¶
- func Chmod(t *testing.T, dest string, mode os.FileMode)
- func CompareTreesWithFiltering(t *testing.T, p, goldPath string, update bool)
- func GoldenPath(t *testing.T) string
- func InstallUpdateFlag()
- func MakeReadOnly(t *testing.T, dest string)
- func NewDbusConn(t *testing.T) *dbus.Conn
- func NormalizeGoldenName(t *testing.T, name string) string
- func StartLocalSystemBus() func()
- func TestFamilyPath(t *testing.T) string
- func Update() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareTreesWithFiltering ¶
CompareTreesWithFiltering allows comparing a goldPath directory to p. Those can be updated via the dedicated flag.
func GoldenPath ¶
GoldenPath returns the golden path for the provided test.
func InstallUpdateFlag ¶
func InstallUpdateFlag()
InstallUpdateFlag install an update flag referenced in this package. The flags need to be parsed before running the tests.
func MakeReadOnly ¶
MakeReadOnly makes dest read only and restore permission on cleanup.
func NewDbusConn ¶
NewDbusConn returns a system dbus connection which automatically close on test shutdown.
func NormalizeGoldenName ¶
NormalizeGoldenName returns the name of the golden file with illegal Windows characters replaced or removed.
func StartLocalSystemBus ¶
func StartLocalSystemBus() func()
StartLocalSystemBus allows to start and set environment variable to a local bus, preventing polluting system ones.
func TestFamilyPath ¶
TestFamilyPath returns the path of the dir for storing fixtures and other files related to the test.
Types ¶
This section is empty.