added acceptance test for listing services
diff --git a/acceptance/rackspace/cdn/v1/service_test.go b/acceptance/rackspace/cdn/v1/service_test.go
index 51e03f7..af73dcf 100644
--- a/acceptance/rackspace/cdn/v1/service_test.go
+++ b/acceptance/rackspace/cdn/v1/service_test.go
@@ -7,6 +7,7 @@
"github.com/rackspace/gophercloud"
os "github.com/rackspace/gophercloud/openstack/cdn/v1/services"
+ "github.com/rackspace/gophercloud/pagination"
"github.com/rackspace/gophercloud/rackspace/cdn/v1/services"
th "github.com/rackspace/gophercloud/testhelper"
)
@@ -26,10 +27,8 @@
t.Log("Retrieving Service")
testServiceGet(t, client, loc)
- /*
- t.Log("Listing Services")
- testServiceList(t, client)
- */
+ t.Log("Listing Services")
+ testServiceList(t, client)
}
func testServiceCreate(t *testing.T, client *gophercloud.ServiceClient) string {
@@ -76,13 +75,20 @@
t.Logf("Successfully updated service at location: %s", loc)
}
-/*
func testServiceList(t *testing.T, client *gophercloud.ServiceClient) {
- err := service.List(client).ExtractErr()
+ err := services.List(client, nil).EachPage(func(page pagination.Page) (bool, error) {
+ serviceList, err := os.ExtractServices(page)
+ th.AssertNoErr(t, err)
+
+ for _, service := range serviceList {
+ t.Logf("Listing service: %+v", service)
+ }
+
+ return true, nil
+ })
+
th.AssertNoErr(t, err)
- t.Logf("Successfully pinged root URL")
}
-*/
func testServiceDelete(t *testing.T, client *gophercloud.ServiceClient, id string) {
err := services.Delete(client, id).ExtractErr()