Jon Perritt | b682313 | 2015-01-21 15:03:58 -0700 | [diff] [blame] | 1 | // +build acceptance |
| 2 | |
| 3 | package v1 |
| 4 | |
| 5 | import ( |
| 6 | "testing" |
| 7 | |
| 8 | "github.com/rackspace/gophercloud" |
| 9 | "github.com/rackspace/gophercloud/rackspace/cdn/v1/base" |
| 10 | th "github.com/rackspace/gophercloud/testhelper" |
| 11 | ) |
| 12 | |
| 13 | func TestBaseOps(t *testing.T) { |
| 14 | client := newClient(t) |
| 15 | t.Log("Retrieving Home Document") |
| 16 | testHomeDocumentGet(t, client) |
| 17 | |
| 18 | t.Log("Pinging root URL") |
| 19 | testPing(t, client) |
| 20 | } |
| 21 | |
| 22 | func testHomeDocumentGet(t *testing.T, client *gophercloud.ServiceClient) { |
| 23 | hd, err := base.Get(client).Extract() |
| 24 | th.AssertNoErr(t, err) |
| 25 | t.Logf("Retrieved home document: %+v", *hd) |
| 26 | } |
| 27 | |
| 28 | func testPing(t *testing.T, client *gophercloud.ServiceClient) { |
| 29 | err := base.Ping(client).ExtractErr() |
| 30 | th.AssertNoErr(t, err) |
| 31 | t.Logf("Successfully pinged root URL") |
| 32 | } |