tests

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 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 GzipContainsFile

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

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

func ZipContainsFile

func ZipContainsFile(t *testing.T, expectedFile, zipArchive 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