packer-cn/builder/amazon/common/ami_config_test.go
Mitchell Hashimoto d7c9658c1c builder/amazon/common: AMIConfig common config
/cc @jmassara - I pulled out the AMI stuff into a common config
struct and also added in the new template stuff (that didn't exist
when you made the pull, so not your fault! :))
2013-08-08 22:50:37 -07:00

24 lines
366 B
Go

package common
import (
"testing"
)
func testAMIConfig() *AMIConfig {
return &AMIConfig{
AMIName: "foo",
}
}
func TestAMIConfigPrepare_Region(t *testing.T) {
c := testAMIConfig()
if err := c.Prepare(nil); err != nil {
t.Fatalf("shouldn't have err: %s", err)
}
c.AMIName = ""
if err := c.Prepare(nil); err == nil {
t.Fatal("should have error")
}
}