Documentation
¶
Index ¶
- type SkillTest
- func (pt *SkillTest) AssertCommandNotRun(cmd string)
- func (pt *SkillTest) AssertCommandRun(cmd string)
- func (pt *SkillTest) AssertError(err error)
- func (pt *SkillTest) AssertErrorContains(err error, expected string)
- func (pt *SkillTest) AssertNoError(err error)
- func (pt *SkillTest) AssertResultChanged(result types.Result)
- func (pt *SkillTest) AssertResultError(result types.Result)
- func (pt *SkillTest) AssertResultMessageContains(result types.Result, expected string)
- func (pt *SkillTest) AssertResultNoError(result types.Result)
- func (pt *SkillTest) AssertResultUnchanged(result types.Result)
- func (pt *SkillTest) Cleanup()
- func (pt *SkillTest) Config() types.NodeConfig
- func (pt *SkillTest) ExpectCommand(cmd, output string) *SkillTest
- func (pt *SkillTest) ExpectError(cmd string, err error) *SkillTest
- func (pt *SkillTest) GetCommands() []string
- func (pt *SkillTest) MockClient() *sshtest.MockClient
- func (pt *SkillTest) Reset()
- func (pt *SkillTest) SetArg(key, value string) *SkillTest
- func (pt *SkillTest) SetArgs(args map[string]string) *SkillTest
- func (pt *SkillTest) SetConfig(cfg types.NodeConfig) *SkillTest
- func (pt *SkillTest) Setup() *SkillTest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SkillTest ¶
type SkillTest struct {
// contains filtered or unexported fields
}
SkillTest provides test helpers for skill testing with mock SSH.
func (*SkillTest) AssertCommandNotRun ¶
AssertCommandNotRun verifies that a command was NOT executed.
func (*SkillTest) AssertCommandRun ¶
AssertCommandRun verifies that a command was executed.
func (*SkillTest) AssertError ¶
AssertError verifies that the error is non-nil.
func (*SkillTest) AssertErrorContains ¶
AssertErrorContains verifies that the error message contains the expected text.
func (*SkillTest) AssertNoError ¶
AssertNoError verifies that the error is nil.
func (*SkillTest) AssertResultChanged ¶
AssertResultChanged verifies that the result indicates changes were made.
func (*SkillTest) AssertResultError ¶
AssertResultError verifies that the result has an error.
func (*SkillTest) AssertResultMessageContains ¶
AssertResultMessageContains verifies that the result message contains the expected text.
func (*SkillTest) AssertResultNoError ¶
AssertResultNoError verifies that the result has no error.
func (*SkillTest) AssertResultUnchanged ¶
AssertResultUnchanged verifies that the result indicates no changes were made.
func (*SkillTest) Cleanup ¶
func (pt *SkillTest) Cleanup()
Cleanup restores the default SSH behavior. Should be called in a defer after Setup.
func (*SkillTest) Config ¶
func (pt *SkillTest) Config() types.NodeConfig
Config returns the test configuration.
func (*SkillTest) ExpectCommand ¶
ExpectCommand sets the expected output for a command.
func (*SkillTest) ExpectError ¶
ExpectError sets the expected error for a command.
func (*SkillTest) GetCommands ¶
GetCommands returns a copy of all executed commands.
func (*SkillTest) MockClient ¶
func (pt *SkillTest) MockClient() *sshtest.MockClient
MockClient returns the mock SSH client for direct manipulation.
func (*SkillTest) Reset ¶
func (pt *SkillTest) Reset()
Reset clears all recorded commands and expectations.