testing

package
v0.0.0-...-37b8e2e Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorAssertionWithEqual

func ErrorAssertionWithEqual(t *testing.T, wantErr, err error) bool

func ExecuteCommand

func ExecuteCommand(cmdFunc TestCmdFunc, cmd string) (stdout string, err error)

A helper to ignore os.Exit(1) errors when running a cobra Command

func ExecuteCommandC

func ExecuteCommandC(root *cobra.Command, args ...string) (stdout string, output string, err error)

A helper to ignore os.Exit(1) errors when running a cobra Command

func ExecuteCommandOfArgs

func ExecuteCommandOfArgs(cmdFunc TestCmdFunc, args ...string) (stdout string, err error)

func Run

func Run(exec func()) (stdout string)

func RunForStdout

func RunForStdout(streams genericiooptions.IOStreams, exec func()) (stdout string)

func TInfo

func TInfo(msg interface{})

func TOut

func TOut(msg interface{})

Types

type FakeRESTClientGetter

type FakeRESTClientGetter struct {
	// contains filtered or unexported fields
}

func NewFakeRESTClientGetter

func NewFakeRESTClientGetter() *FakeRESTClientGetter

func (FakeRESTClientGetter) ToRESTConfig

func (f FakeRESTClientGetter) ToRESTConfig() (*types.Config, error)

func (FakeRESTClientGetter) ToRawGLConfigLoader

func (f FakeRESTClientGetter) ToRawGLConfigLoader() cmdutil.ClientConfig

type TestCmdFunc

type TestCmdFunc = func(buffer *bytes.Buffer) *cobra.Command

Jump to

Keyboard shortcuts

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