Updated test as the winrmtest package was tweaked a little...

The winrmtest package update is merged now, so this can be merged now
as well…
This commit is contained in:
Sander van Harmelen 2015-05-01 18:33:49 +02:00
parent 2689601bc3
commit b6660a1abe
1 changed files with 4 additions and 8 deletions

View File

@ -16,30 +16,26 @@ func newMockWinRMServer(t *testing.T) *winrmtest.Remote {
wrm := winrmtest.NewRemote() wrm := winrmtest.NewRemote()
wrm.CommandFunc( wrm.CommandFunc(
"echo foo", winrmtest.MatchText("echo foo"),
"",
func(out, err io.Writer) int { func(out, err io.Writer) int {
out.Write([]byte("foo")) out.Write([]byte("foo"))
return 0 return 0
}) })
wrm.CommandFunc( wrm.CommandFunc(
"file-copy", winrmtest.MatchPattern(`^echo c29tZXRoaW5n >> ".*"$`),
`^echo c29tZXRoaW5n >> ".*"$`,
func(out, err io.Writer) int { func(out, err io.Writer) int {
return 0 return 0
}) })
wrm.CommandFunc( wrm.CommandFunc(
"file-encode", winrmtest.MatchPattern(`^powershell.exe -EncodedCommand .*$`),
`^powershell.exe -EncodedCommand .*$`,
func(out, err io.Writer) int { func(out, err io.Writer) int {
return 0 return 0
}) })
wrm.CommandFunc( wrm.CommandFunc(
"powershell", winrmtest.MatchText("powershell"),
"",
func(out, err io.Writer) int { func(out, err io.Writer) int {
return 0 return 0
}) })