testcli

package
v0.61.1 Latest Latest
Warning

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

Go to latest
Published: May 13, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fixture

type Fixture struct {
	Admin   *testadmin.Fixture
	HomeDir string
}

Fixture represents a (possibly authenticated) CLI installation.

func New

func New(t *testing.T, adm *testadmin.Fixture, token string) *Fixture

New creates a new Fixture for the given admin service test fixture and (optional) user access token.

func NewWithUser

func NewWithUser(t *testing.T, adm *testadmin.Fixture) *Fixture

NewWithUser is similar to New, but also creates a new user and authenticates the Fixture with a token for that user.

func (*Fixture) Run

func (f *Fixture) Run(t *testing.T, args ...string) Result

Run executes the CLI with the given arguments and captures the output.

func (*Fixture) RunWithInput

func (f *Fixture) RunWithInput(t *testing.T, input string, args ...string) Result

RunWithInput executes the CLI with the given input and arguments and captures the output.

type Result

type Result struct {
	ExitCode int
	Output   string
}

Result represents the output of a CLI invocation.

Jump to

Keyboard shortcuts

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