cmdtesting

package
v1.5.0-alpha9 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseSuite

type BaseSuite struct {
	suite.Suite
	Node            *node.Node
	ClientV2        clientv2.API
	Config          types.Bacalhau
	Host            string
	Port            uint16
	AllowListedPath string
}

func (*BaseSuite) Execute added in v1.4.0

func (s *BaseSuite) Execute(args ...string) (stdout string, stderr string, err error)

Execute executes a cobra command with the given arguments. The api-host and api-port flags are automatically added if they are not provided in `args`. They are set to the values of `s.Host` and `s.Port` respectively. The stdout and stderr of the command are returned as well as any error that occurred while executing the command.

func (*BaseSuite) ExecuteTestCobraCommand added in v1.2.1

func (s *BaseSuite) ExecuteTestCobraCommand(args ...string) (c *cobra.Command, output string, err error)

ExecuteTestCobraCommand executes a cobra command with the given arguments. The api-host and api-port flags are automatically added if they are not provided in `args`. They are set to the values of `s.Host` and `s.Port` respectively.

func (*BaseSuite) ExecuteTestCobraCommandWithStdin added in v1.2.1

func (s *BaseSuite) ExecuteTestCobraCommandWithStdin(stdin io.Reader, args ...string) (c *cobra.Command, output string, err error)

ExecuteTestCobraCommandWithStdin executes a cobra command with the given arguments and with a specific stdin. The api-host and api-port flags are automatically added if they are not provided in `args`. They are set to the values of `s.Host` and `s.Port` respectively.

func (*BaseSuite) ExecuteTestCobraCommandWithStdinBytes added in v1.2.1

func (s *BaseSuite) ExecuteTestCobraCommandWithStdinBytes(stdin []byte, args ...string) (c *cobra.Command, output string, err error)

ExecuteTestCobraCommandWithStdinBytes executes a cobra command with the given arguments and with a specific stdin bytes. The api-host and api-port flags are automatically added if they are not provided in `args`. They are set to the values of `s.Host` and `s.Port` respectively.

func (*BaseSuite) SetupTest

func (s *BaseSuite) SetupTest()

before each test

func (*BaseSuite) TearDownTest

func (s *BaseSuite) TearDownTest()

After each test

type BaseTLSSuite added in v1.2.2

type BaseTLSSuite struct {
	BaseSuite
	TempCACertFilePath string
}

func (*BaseTLSSuite) SetupTest added in v1.2.2

func (s *BaseTLSSuite) SetupTest()

before each test

func (*BaseTLSSuite) TearDownTest added in v1.2.2

func (s *BaseTLSSuite) TearDownTest()

After each test

Jump to

Keyboard shortcuts

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