terraform/vendor/github.com/dylanmei/winrmtest
Paul Hinze 8209b40526 vendor: Recapture deps w/ latest godep
The original contents of `vendor` were inadvertently captured with an
older version of `godep`. Here, we recapture dependencies by running the
following:

```
godep restore -v
cat Godeps/Godeps.json | jq -r '.Deps[].ImportPath' | xargs godep update -v
```

The newer godep makes the following changes as it captures dependencies:

 * Skips test files
 * Copies `LICENSE` / `PATENTS` files

There is also an additional diff in `golang.org/x/sys/unix` that looks
very similar to the diff between `master..c65f27f` in that repo, so I'm
guessing that dependency was accidentally captured from master instead
of the commit saved to `Godeps.json`.

All in all, these changes should all be "more correct" and result in
smaller diffs for any future updates made to dependencies.
2016-02-10 10:45:16 -06:00
..
LICENSE Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
README.md Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
remote.go Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00
wsman.go Vendor all dependencies w/ Godep 2016-01-29 15:08:48 -06:00

README.md

winrmtest

An in-progress testing package to compliment the masterzen/winrm Go-based winrm library.

My primary use-case for this is for dylanmei/packer-communicator-winrm, a Packer communicator plugin for interacting with machines using Windows Remote Management.

Example Use

A fictitious "Windows tools" package.


package wintools

import (
	"io"
	"testing"
	"github.com/dylanmei/winrmtest"
)

func Test_empty_temp_directory(t *testing.T) {
	r := winrmtest.NewRemote()
	defer r.Close()

	r.CommandFunc(wimrmtest.MatchText("dir C:\Temp"), func(out, err io.Writer) int {
		out.Write([]byte(` Volume in drive C is Windows 2012 R2
 Volume Serial Number is XXXX-XXXX

 Directory of C:\

File Not Found`))
		return 0
	})

	lister := NewDirectoryLister(r.Host, r.Port)
	list, _ := lister.TempDirectory()

	if count := len(list.Dirs()); count != 0 {
		t.Errorf("Expected 0 directories but found %d.\n", count)
	}

	if count := len(list.Files()); count != 0 {
		t.Errorf("Expected 0 files but found %d.\n", count)
	}
}