From 7f3f5f4bfaf630a9a6d2e0fb329bc290547af5aa Mon Sep 17 00:00:00 2001 From: Chulki Lee Date: Mon, 11 Jan 2016 13:02:38 -0800 Subject: [PATCH] add tests for all ami regions --- builder/amazon/common/ami_config_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/builder/amazon/common/ami_config_test.go b/builder/amazon/common/ami_config_test.go index 9e2baa41d..e08d5d531 100644 --- a/builder/amazon/common/ami_config_test.go +++ b/builder/amazon/common/ami_config_test.go @@ -30,6 +30,13 @@ func TestAMIConfigPrepare_regions(t *testing.T) { t.Fatalf("shouldn't have err: %s", err) } + c.AMIRegions = []string{"ap-northeast-1", "ap-southeast-1", "ap-southeast-2", + "cn-north-1", "eu-central-1", "eu-west-1", "sa-east-1", + "us-east-1", "us-gov-west-1", "us-west-1", "us-west-2"} + if err := c.Prepare(nil); err != nil { + t.Fatalf("shouldn't have err: %s", err) + } + c.AMIRegions = []string{"foo"} if err := c.Prepare(nil); err == nil { t.Fatal("should have error")