github.com/turtlemonvh/terraform@v0.6.9-0.20151204001754-8e40b6b855e8/builtin/providers/aws/website_endpoint_url_test.go (about) 1 package aws 2 3 import "testing" 4 5 // http://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteEndpoints.html 6 var websiteEndpoints = []struct { 7 in string 8 out string 9 }{ 10 {"", "bucket-name.s3-website-us-east-1.amazonaws.com"}, 11 {"us-west-2", "bucket-name.s3-website-us-west-2.amazonaws.com"}, 12 {"us-west-1", "bucket-name.s3-website-us-west-1.amazonaws.com"}, 13 {"eu-west-1", "bucket-name.s3-website-eu-west-1.amazonaws.com"}, 14 {"eu-central-1", "bucket-name.s3-website.eu-central-1.amazonaws.com"}, 15 {"ap-southeast-1", "bucket-name.s3-website-ap-southeast-1.amazonaws.com"}, 16 {"ap-northeast-1", "bucket-name.s3-website-ap-northeast-1.amazonaws.com"}, 17 {"ap-southeast-2", "bucket-name.s3-website-ap-southeast-2.amazonaws.com"}, 18 {"sa-east-1", "bucket-name.s3-website-sa-east-1.amazonaws.com"}, 19 } 20 21 func TestWebsiteEndpointUrl(t *testing.T) { 22 for _, tt := range websiteEndpoints { 23 s := WebsiteEndpoint("bucket-name", tt.in) 24 if s.Endpoint != tt.out { 25 t.Errorf("WebsiteEndpointUrl(\"bucket-name\", %q) => %q, want %q", tt.in, s.Endpoint, tt.out) 26 } 27 } 28 }