github.com/recobe182/terraform@v0.8.5-0.20170117231232-49ab22a935b7/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-south-1", "bucket-name.s3-website.ap-south-1.amazonaws.com"},
    16  	{"ap-southeast-1", "bucket-name.s3-website-ap-southeast-1.amazonaws.com"},
    17  	{"ap-northeast-1", "bucket-name.s3-website-ap-northeast-1.amazonaws.com"},
    18  	{"ap-southeast-2", "bucket-name.s3-website-ap-southeast-2.amazonaws.com"},
    19  	{"ap-northeast-2", "bucket-name.s3-website.ap-northeast-2.amazonaws.com"},
    20  	{"sa-east-1", "bucket-name.s3-website-sa-east-1.amazonaws.com"},
    21  }
    22  
    23  func TestWebsiteEndpointUrl(t *testing.T) {
    24  	for _, tt := range websiteEndpoints {
    25  		s := WebsiteEndpoint("bucket-name", tt.in)
    26  		if s.Endpoint != tt.out {
    27  			t.Errorf("WebsiteEndpointUrl(\"bucket-name\", %q) => %q, want %q", tt.in, s.Endpoint, tt.out)
    28  		}
    29  	}
    30  }