blob: c32bf253da2eed036bec9a659af3811608b0beab [file] [log] [blame]
Jon Perrittd4106ec2015-01-22 08:51:06 -07001// +build acceptance
2
3package v1
4
5import (
6 "testing"
7
8 "github.com/rackspace/gophercloud"
9 osServiceAssets "github.com/rackspace/gophercloud/openstack/cdn/v1/serviceassets"
10 "github.com/rackspace/gophercloud/rackspace/cdn/v1/serviceassets"
11 th "github.com/rackspace/gophercloud/testhelper"
12)
13
14func TestServiceAsset(t *testing.T) {
15 client := newClient(t)
16
17 t.Log("Creating Service")
Jon Perritt1bda9c12015-01-29 12:16:08 -070018 loc := testServiceCreate(t, client, "test-site-2")
Jon Perrittd4106ec2015-01-22 08:51:06 -070019 t.Logf("Created service at location: %s", loc)
20
21 t.Log("Deleting Service Assets")
22 testServiceAssetDelete(t, client, loc)
23}
24
25func testServiceAssetDelete(t *testing.T, client *gophercloud.ServiceClient, url string) {
26 deleteOpts := osServiceAssets.DeleteOpts{
27 All: true,
28 }
29 err := serviceassets.Delete(client, url, deleteOpts).ExtractErr()
30 th.AssertNoErr(t, err)
31 t.Log("Successfully deleted all Service Assets")
32}