go fmt
diff --git a/openstack/cdn/v1/flavors/requests_test.go b/openstack/cdn/v1/flavors/requests_test.go
index 7ddf1b1..f731738 100644
--- a/openstack/cdn/v1/flavors/requests_test.go
+++ b/openstack/cdn/v1/flavors/requests_test.go
@@ -1,90 +1,89 @@
package flavors
import (
- "testing"
+ "testing"
- "github.com/rackspace/gophercloud"
- "github.com/rackspace/gophercloud/pagination"
- th "github.com/rackspace/gophercloud/testhelper"
- fake "github.com/rackspace/gophercloud/testhelper/client"
+ "github.com/rackspace/gophercloud"
+ "github.com/rackspace/gophercloud/pagination"
+ th "github.com/rackspace/gophercloud/testhelper"
+ fake "github.com/rackspace/gophercloud/testhelper/client"
)
func TestList(t *testing.T) {
- th.SetupHTTP()
- defer th.TeardownHTTP()
+ th.SetupHTTP()
+ defer th.TeardownHTTP()
- HandleListCDNFlavorsSuccessfully(t)
+ HandleListCDNFlavorsSuccessfully(t)
- count := 0
+ count := 0
- err := List(fake.ServiceClient()).EachPage(func(page pagination.Page) (bool, error) {
- count++
- actual, err := ExtractFlavors(page)
- if err != nil {
- t.Errorf("Failed to extract flavors: %v", err)
- return false, err
- }
+ err := List(fake.ServiceClient()).EachPage(func(page pagination.Page) (bool, error) {
+ count++
+ actual, err := ExtractFlavors(page)
+ if err != nil {
+ t.Errorf("Failed to extract flavors: %v", err)
+ return false, err
+ }
- expected := []Flavor{
- Flavor{
- ID: "europe",
- Providers: []Provider{
- Provider{
- Provider: "Fastly",
- Links: []gophercloud.Link{
- gophercloud.Link{
- Href: "http://www.fastly.com",
- Rel: "provider_url",
- },
- },
- },
- },
- Links: []gophercloud.Link{
- gophercloud.Link{
- Href: "https://www.poppycdn.io/v1.0/flavors/europe",
- Rel: "self",
- },
- },
- },
- }
+ expected := []Flavor{
+ Flavor{
+ ID: "europe",
+ Providers: []Provider{
+ Provider{
+ Provider: "Fastly",
+ Links: []gophercloud.Link{
+ gophercloud.Link{
+ Href: "http://www.fastly.com",
+ Rel: "provider_url",
+ },
+ },
+ },
+ },
+ Links: []gophercloud.Link{
+ gophercloud.Link{
+ Href: "https://www.poppycdn.io/v1.0/flavors/europe",
+ Rel: "self",
+ },
+ },
+ },
+ }
- th.CheckDeepEquals(t, expected, actual)
+ th.CheckDeepEquals(t, expected, actual)
- return true, nil
- })
- th.AssertNoErr(t, err)
- th.CheckEquals(t, 1, count)
+ return true, nil
+ })
+ th.AssertNoErr(t, err)
+ th.CheckEquals(t, 1, count)
}
func TestGet(t *testing.T) {
- th.SetupHTTP()
- defer th.TeardownHTTP()
+ th.SetupHTTP()
+ defer th.TeardownHTTP()
- HandleGetCDNFlavorSuccessfully(t)
+ HandleGetCDNFlavorSuccessfully(t)
- expected := &Flavor{
- ID: "asia",
- Providers: []Provider{
- Provider{
- Provider: "ChinaCache",
- Links: []gophercloud.Link{
- gophercloud.Link{
- Href: "http://www.chinacache.com",
- Rel: "provider_url",
- },
- },
- },
- },
- Links: []gophercloud.Link{
- gophercloud.Link{
- Href: "https://www.poppycdn.io/v1.0/flavors/asia",
- Rel: "self",
- },
- },
- }
+ expected := &Flavor{
+ ID: "asia",
+ Providers: []Provider{
+ Provider{
+ Provider: "ChinaCache",
+ Links: []gophercloud.Link{
+ gophercloud.Link{
+ Href: "http://www.chinacache.com",
+ Rel: "provider_url",
+ },
+ },
+ },
+ },
+ Links: []gophercloud.Link{
+ gophercloud.Link{
+ Href: "https://www.poppycdn.io/v1.0/flavors/asia",
+ Rel: "self",
+ },
+ },
+ }
-
- actual, err := Get(fake.ServiceClient(), "asia").Extract()
- th.AssertNoErr(t, err)
- th.AssertDeepEquals(t, expected, actual)
+ actual, err := Get(fake.ServiceClient(), "asia").Extract()
+ th.AssertNoErr(t, err)
+ th.AssertDeepEquals(t, expected, actual)
}