blob: 854d2fd7c442b9fa5601aca561c8ea63dc4e0816 [file] [log] [blame]
Jon Perrittd4106ec2015-01-22 08:51:06 -07001// +build acceptance
2
3package v1
4
5import (
6 "testing"
7
Jon Perritt27249f42016-02-18 10:35:59 -06008 "github.com/gophercloud/gophercloud"
9 osServiceAssets "github.com/gophercloud/gophercloud/openstack/cdn/v1/serviceassets"
10 "github.com/gophercloud/gophercloud/rackspace/cdn/v1/serviceassets"
11 th "github.com/gophercloud/gophercloud/testhelper"
Jon Perrittd4106ec2015-01-22 08:51:06 -070012)
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}