Add test for empty remote_type value

This commit is contained in:
Marc Carmier 2017-02-15 22:11:27 +01:00
parent 86c0c859c5
commit 5c11a2e594
1 changed files with 13 additions and 1 deletions

View File

@ -156,7 +156,7 @@ func TestBuilderPrepare_RemoteType(t *testing.T) {
}
config["remote_host"] = ""
config["remote_type"] = "esx5"
config["remote_type"] = ""
// Bad
warns, err = b.Prepare(config)
if len(warns) > 0 {
@ -177,6 +177,18 @@ func TestBuilderPrepare_RemoteType(t *testing.T) {
if err != nil {
t.Fatalf("should not have error: %s", err)
}
// Good
config["remote_type"] = "esx5"
config["remote_host"] = "foobar.example.com"
b = Builder{}
warns, err = b.Prepare(config)
if len(warns) > 0 {
t.Fatalf("bad: %#v", warns)
}
if err != nil {
t.Fatalf("should not have error: %s", err)
}
}
func TestBuilderPrepare_Format(t *testing.T) {