ctltest

package
v0.156.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateConfigFile

func CreateConfigFile(cfg *api.ClusterConfig) string

CreateConfigFile creates a temporary configuration file for testing by marshalling the given object in yaml. It returns the path to the file

Types

type CommandFunction

type CommandFunction func(*cmdutils.Cmd, func(*cmdutils.Cmd) error)

type MockCmd

type MockCmd struct {
	Cmd *cmdutils.Cmd
	// contains filtered or unexported fields
}

func NewMockCmd

func NewMockCmd(cmdFunc CommandFunction, parentCommand string, args ...string) *MockCmd

NewMockCmd returns a mock Cmd for a parent command (such as enable, get, utils) to be used for testing cli related features like flag and config file loading

func (MockCmd) Execute

func (c MockCmd) Execute() (string, error)

Jump to

Keyboard shortcuts

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