MCPcopy Index your code
hub / github.com/apache/cloudstack-go / TestMetricsService

Function TestMetricsService

test/MetricsService_test.go:28–50  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

26)
27
28func TestMetricsService(t *testing.T) {
29 service := "MetricsService"
30 response, err := readData(service)
31 if err != nil {
32 t.Skipf("Skipping test as %v", err)
33 }
34 server := CreateTestServer(t, response)
35 client := cloudstack.NewClient(server.URL, "APIKEY", "SECRETKEY", true)
36 defer server.Close()
37
38 testlistInfrastructure := func(t *testing.T) {
39 if _, ok := response["listInfrastructure"]; !ok {
40 t.Skipf("Skipping as no json response is provided in testdata")
41 }
42 p := client.Metrics.NewListInfrastructureParams()
43 _, err := client.Metrics.ListInfrastructure(p)
44 if err != nil {
45 t.Errorf(err.Error())
46 }
47 }
48 t.Run("ListInfrastructure", testlistInfrastructure)
49
50}

Callers

nothing calls this directly

Calls 6

NewClientFunction · 0.92
readDataFunction · 0.85
CreateTestServerFunction · 0.85
ListInfrastructureMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected