File: endpoint_test.go

package info (click to toggle)
golang-github-denverdino-aliyungo 0.0~git20180921.13fa8aa-4
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 1,824 kB
  • sloc: xml: 1,359; makefile: 3
file content (50 lines) | stat: -rw-r--r-- 992 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package common

import (
	"testing"
)

func TestLoadEndpointFromFile(t *testing.T) {

}

func TestClient_DescribeOpenAPIEndpoint(t *testing.T) {
	client := NewTestClientForDebug()
	services := []string{"ecs", "slb", "rds", "vpc"}
	regions := []Region{
		APNorthEast1,
		APSouthEast2,
		APSouthEast3,
		MEEast1,
		EUCentral1,
		Zhangjiakou,
		Huhehaote,
		Hangzhou,
		Qingdao,
		Beijing,
		Shanghai,
		Shenzhen,
	}

	for _, region := range regions {
		for _, service := range services {
			endpoint := client.DescribeOpenAPIEndpoint(Region(region), service)
			t.Logf("Endpoint[%s][%s]=%s", string(region), service, endpoint)
		}
	}
}

func TestLocationClient_DescribeEndpoints(t *testing.T) {
	client := NewTestClientForDebug()
	args := &DescribeEndpointsArgs{
		Id:          "cn-zhangjiakou",
		ServiceCode: "slb",
		Type:        "openAPI",
	}
	response, err := client.DescribeEndpoints(args)
	if err != nil {
		t.Fatalf("Error %++v", err)
	} else {
		t.Logf("Result = %++v", response)
	}
}