| 1 | package common |
| 2 | |
| 3 | import ( |
| 4 | "testing" |
| 5 | ) |
| 6 | |
| 7 | func TestLoadEndpointFromFile(t *testing.T) { |
| 8 | |
| 9 | } |
| 10 | |
| 11 | func TestClient_DescribeOpenAPIEndpoint(t *testing.T) { |
| 12 | client := NewTestClientForDebug() |
| 13 | services := []string{"ecs", "slb", "rds", "vpc"} |
| 14 | regions := []Region{ |
| 15 | APNorthEast1, |
| 16 | APSouthEast2, |
| 17 | APSouthEast3, |
| 18 | MEEast1, |
| 19 | EUCentral1, |
| 20 | Zhangjiakou, |
| 21 | Huhehaote, |
| 22 | Hangzhou, |
| 23 | Qingdao, |
| 24 | Beijing, |
| 25 | Shanghai, |
| 26 | Shenzhen, |
| 27 | } |
| 28 | |
| 29 | for _, region := range regions { |
| 30 | for _, service := range services { |
| 31 | endpoint := client.DescribeOpenAPIEndpoint(Region(region), service) |
| 32 | t.Logf("Endpoint[%s][%s]=%s", string(region), service, endpoint) |
| 33 | } |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | func TestLocationClient_DescribeEndpoints(t *testing.T) { |
| 38 | client := NewTestClientForDebug() |
| 39 | args := &DescribeEndpointsArgs{ |
| 40 | Id: "cn-zhangjiakou", |
| 41 | ServiceCode: "slb", |
| 42 | Type: "openAPI", |
| 43 | } |
| 44 | response, err := client.DescribeEndpoints(args) |
| 45 | if err != nil { |
| 46 | t.Fatalf("Error %++v", err) |
| 47 | } else { |
| 48 | t.Logf("Result = %++v", response) |
| 49 | } |
| 50 | } |