tests

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

package tests provides helper functions and mocks for running tests

package tests provides helper functions and mocks for running tests

package tests provides helper functions and mocks for running tests

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CaptureOutput

func CaptureOutput(f func()) (string, error)

CaptureOutput captures standard output for a function f and returns the output string

func ContainThisFileInTheGzip added in v0.4.0

func ContainThisFileInTheGzip(expectedFilePath string, actual interface{}) (success bool, err error)

func GzipContainsFile

func GzipContainsFile(t *testing.T, expectedFile, gzipArchive string)

func MatchFile added in v0.4.0

func MatchFile(expectedFile string, actual interface{}) (success bool, err error)

func PrintTree

func PrintTree(dir string, indent string)

PrintTree is a helper function to print directory structure recursively.

func TarContainsFile

func TarContainsFile(t *testing.T, expectedFile, archiveFile string)

func TgzContainsFile

func TgzContainsFile(t *testing.T, expectedFile, archiveFile string)

func Tree

func Tree(dir string)

Tree prints the directory structure in a tree-like format.

func TreeToString

func TreeToString(dir string) string

Types

type MockCli

type MockCli struct {
	Calls          [][]string
	StoredResponse []string
	StoredErrors   []error
}

func (*MockCli) Execute

func (m *MockCli) Execute(args ...string) (out string, err error)

func (*MockCli) ExecuteAndStreamOutput

func (m *MockCli) ExecuteAndStreamOutput(output cli.OutputHandler, args ...string) (err error)

Jump to

Keyboard shortcuts

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