Add additional tests for SSH

Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
This commit is contained in:
Nathan LeClaire
2015-12-03 19:45:15 -08:00
parent f17cce330c
commit aa54a5f272
4 changed files with 117 additions and 12 deletions

View File

@@ -0,0 +1,21 @@
package sshtest
type CmdResult struct {
Out string
Err error
}
type FakeClient struct {
ActivatedShell []string
Outputs map[string]CmdResult
}
func (fsc *FakeClient) Output(command string) (string, error) {
outerr := fsc.Outputs[command]
return outerr.Out, outerr.Err
}
func (fsc *FakeClient) Shell(args ...string) error {
fsc.ActivatedShell = args
return nil
}