1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
package vsphere_template
import (
"testing"
)
func getTestConfig() Config {
return Config{
Username: "me",
Password: "notpassword",
Host: "myhost",
}
}
func TestConfigure_Good(t *testing.T) {
var p PostProcessor
config := getTestConfig()
err := p.Configure(config)
if err != nil {
t.Errorf("Error: %s", err)
}
}
func TestConfigure_ReRegisterVM(t *testing.T) {
var p PostProcessor
config := getTestConfig()
err := p.Configure(config)
if err != nil {
t.Errorf("Error: %s", err)
}
if p.config.ReregisterVM.False() {
t.Errorf("This should default to unset, not false.")
}
}
|