mirror of
https://github.com/Luzifer/mondash.git
synced 2024-12-24 04:51:18 +00:00
28 lines
660 B
Go
28 lines
660 B
Go
package endpoints
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestGlobalEndpoints(t *testing.T) {
|
|
region := "mock-region-1"
|
|
svcs := []string{"cloudfront", "iam", "importexport", "route53", "sts"}
|
|
|
|
for _, name := range svcs {
|
|
ep, sr := EndpointForRegion(name, region)
|
|
assert.Equal(t, name+".amazonaws.com", ep)
|
|
assert.Equal(t, "us-east-1", sr)
|
|
}
|
|
}
|
|
|
|
func TestServicesInCN(t *testing.T) {
|
|
region := "cn-north-1"
|
|
svcs := []string{"cloudfront", "iam", "importexport", "route53", "sts", "s3"}
|
|
|
|
for _, name := range svcs {
|
|
ep, _ := EndpointForRegion(name, region)
|
|
assert.Equal(t, name+"."+region+".amazonaws.com.cn", ep)
|
|
}
|
|
}
|