testutils

package
v1.13.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunCmdAssertion

func RunCmdAssertion(t *testing.T, args Args, assertion Assertion)

RunCmdAssertion tests a `*cobra.Command` and uses the testing.T struct to return any unmatched assertions.

Types

type Args

type Args struct {
	Cmd  *cobra.Command
	Args []string
	Cfg  MockCfg
}

Args represent are required args to test a command.

type Assertion

type Assertion struct {
	Err    string
	Stdout string
	Stderr string
}

Assertion to use for tests.

type MockCfg

type MockCfg struct {
	Responses    []mock.Response
	Out          io.Writer
	Err          io.Writer
	OutputFormat string
	Format       string
	Region       string

	Force   bool
	Verbose bool
}

MockCfg represents a small and targeted amount of `ecctl.Config` options aimed at making mocking convenient and easy.

Jump to

Keyboard shortcuts

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