move unit tests into 'testing' directories
diff --git a/openstack/cdn/v1/base/testing/doc.go b/openstack/cdn/v1/base/testing/doc.go
new file mode 100644
index 0000000..7603f83
--- /dev/null
+++ b/openstack/cdn/v1/base/testing/doc.go
@@ -0,0 +1 @@
+package testing
diff --git a/openstack/cdn/v1/base/fixtures.go b/openstack/cdn/v1/base/testing/fixtures.go
similarity index 97%
rename from openstack/cdn/v1/base/fixtures.go
rename to openstack/cdn/v1/base/testing/fixtures.go
index 226edae..f1f4ac0 100644
--- a/openstack/cdn/v1/base/fixtures.go
+++ b/openstack/cdn/v1/base/testing/fixtures.go
@@ -1,6 +1,4 @@
-// +build fixtures
-
-package base
+package testing
 
 import (
 	"fmt"
diff --git a/openstack/cdn/v1/base/requests_test.go b/openstack/cdn/v1/base/testing/requests_test.go
similarity index 78%
rename from openstack/cdn/v1/base/requests_test.go
rename to openstack/cdn/v1/base/testing/requests_test.go
index a0559e3..cd1209b 100644
--- a/openstack/cdn/v1/base/requests_test.go
+++ b/openstack/cdn/v1/base/testing/requests_test.go
@@ -1,8 +1,9 @@
-package base
+package testing
 
 import (
 	"testing"
 
+	"github.com/gophercloud/gophercloud/openstack/cdn/v1/base"
 	th "github.com/gophercloud/gophercloud/testhelper"
 	fake "github.com/gophercloud/gophercloud/testhelper/client"
 )
@@ -12,10 +13,10 @@
 	defer th.TeardownHTTP()
 	HandleGetSuccessfully(t)
 
-	actual, err := Get(fake.ServiceClient()).Extract()
+	actual, err := base.Get(fake.ServiceClient()).Extract()
 	th.CheckNoErr(t, err)
 
-	expected := HomeDocument{
+	expected := base.HomeDocument{
 		"rel/cdn": map[string]interface{}{
 			"href-template": "services{?marker,limit}",
 			"href-vars": map[string]interface{}{
@@ -38,6 +39,6 @@
 	defer th.TeardownHTTP()
 	HandlePingSuccessfully(t)
 
-	err := Ping(fake.ServiceClient()).ExtractErr()
+	err := base.Ping(fake.ServiceClient()).ExtractErr()
 	th.CheckNoErr(t, err)
 }
diff --git a/openstack/cdn/v1/flavors/testing/doc.go b/openstack/cdn/v1/flavors/testing/doc.go
new file mode 100644
index 0000000..7603f83
--- /dev/null
+++ b/openstack/cdn/v1/flavors/testing/doc.go
@@ -0,0 +1 @@
+package testing
diff --git a/openstack/cdn/v1/flavors/fixtures.go b/openstack/cdn/v1/flavors/testing/fixtures.go
similarity index 98%
rename from openstack/cdn/v1/flavors/fixtures.go
rename to openstack/cdn/v1/flavors/testing/fixtures.go
index 5d07491..ed97247 100644
--- a/openstack/cdn/v1/flavors/fixtures.go
+++ b/openstack/cdn/v1/flavors/testing/fixtures.go
@@ -1,6 +1,4 @@
-// +build fixtures
-
-package flavors
+package testing
 
 import (
 	"fmt"
diff --git a/openstack/cdn/v1/flavors/requests_test.go b/openstack/cdn/v1/flavors/testing/requests_test.go
similarity index 76%
rename from openstack/cdn/v1/flavors/requests_test.go
rename to openstack/cdn/v1/flavors/testing/requests_test.go
index 0aeda00..bc4b1a5 100644
--- a/openstack/cdn/v1/flavors/requests_test.go
+++ b/openstack/cdn/v1/flavors/testing/requests_test.go
@@ -1,9 +1,10 @@
-package flavors
+package testing
 
 import (
 	"testing"
 
 	"github.com/gophercloud/gophercloud"
+	"github.com/gophercloud/gophercloud/openstack/cdn/v1/flavors"
 	"github.com/gophercloud/gophercloud/pagination"
 	th "github.com/gophercloud/gophercloud/testhelper"
 	fake "github.com/gophercloud/gophercloud/testhelper/client"
@@ -17,19 +18,19 @@
 
 	count := 0
 
-	err := List(fake.ServiceClient()).EachPage(func(page pagination.Page) (bool, error) {
+	err := flavors.List(fake.ServiceClient()).EachPage(func(page pagination.Page) (bool, error) {
 		count++
-		actual, err := ExtractFlavors(page)
+		actual, err := flavors.ExtractFlavors(page)
 		if err != nil {
 			t.Errorf("Failed to extract flavors: %v", err)
 			return false, err
 		}
 
-		expected := []Flavor{
-			Flavor{
+		expected := []flavors.Flavor{
+			{
 				ID: "europe",
-				Providers: []Provider{
-					Provider{
+				Providers: []flavors.Provider{
+					{
 						Provider: "Fastly",
 						Links: []gophercloud.Link{
 							gophercloud.Link{
@@ -62,10 +63,10 @@
 
 	HandleGetCDNFlavorSuccessfully(t)
 
-	expected := &Flavor{
+	expected := &flavors.Flavor{
 		ID: "asia",
-		Providers: []Provider{
-			Provider{
+		Providers: []flavors.Provider{
+			{
 				Provider: "ChinaCache",
 				Links: []gophercloud.Link{
 					gophercloud.Link{
@@ -83,7 +84,7 @@
 		},
 	}
 
-	actual, err := Get(fake.ServiceClient(), "asia").Extract()
+	actual, err := flavors.Get(fake.ServiceClient(), "asia").Extract()
 	th.AssertNoErr(t, err)
 	th.AssertDeepEquals(t, expected, actual)
 }
diff --git a/openstack/cdn/v1/serviceassets/requests_test.go b/openstack/cdn/v1/serviceassets/requests_test.go
deleted file mode 100644
index 1204943..0000000
--- a/openstack/cdn/v1/serviceassets/requests_test.go
+++ /dev/null
@@ -1,18 +0,0 @@
-package serviceassets
-
-import (
-	"testing"
-
-	th "github.com/gophercloud/gophercloud/testhelper"
-	fake "github.com/gophercloud/gophercloud/testhelper/client"
-)
-
-func TestDelete(t *testing.T) {
-	th.SetupHTTP()
-	defer th.TeardownHTTP()
-
-	HandleDeleteCDNAssetSuccessfully(t)
-
-	err := Delete(fake.ServiceClient(), "96737ae3-cfc1-4c72-be88-5d0e7cc9a3f0", nil).ExtractErr()
-	th.AssertNoErr(t, err)
-}
diff --git a/openstack/cdn/v1/serviceassets/testing/doc.go b/openstack/cdn/v1/serviceassets/testing/doc.go
new file mode 100644
index 0000000..7603f83
--- /dev/null
+++ b/openstack/cdn/v1/serviceassets/testing/doc.go
@@ -0,0 +1 @@
+package testing
diff --git a/openstack/cdn/v1/serviceassets/fixtures.go b/openstack/cdn/v1/serviceassets/testing/fixtures.go
similarity index 93%
rename from openstack/cdn/v1/serviceassets/fixtures.go
rename to openstack/cdn/v1/serviceassets/testing/fixtures.go
index a66c503..3172d30 100644
--- a/openstack/cdn/v1/serviceassets/fixtures.go
+++ b/openstack/cdn/v1/serviceassets/testing/fixtures.go
@@ -1,6 +1,4 @@
-// +build fixtures
-
-package serviceassets
+package testing
 
 import (
 	"net/http"
diff --git a/openstack/cdn/v1/serviceassets/testing/requests_test.go b/openstack/cdn/v1/serviceassets/testing/requests_test.go
new file mode 100644
index 0000000..ff2073b
--- /dev/null
+++ b/openstack/cdn/v1/serviceassets/testing/requests_test.go
@@ -0,0 +1,19 @@
+package testing
+
+import (
+	"testing"
+
+	"github.com/gophercloud/gophercloud/openstack/cdn/v1/serviceassets"
+	th "github.com/gophercloud/gophercloud/testhelper"
+	fake "github.com/gophercloud/gophercloud/testhelper/client"
+)
+
+func TestDelete(t *testing.T) {
+	th.SetupHTTP()
+	defer th.TeardownHTTP()
+
+	HandleDeleteCDNAssetSuccessfully(t)
+
+	err := serviceassets.Delete(fake.ServiceClient(), "96737ae3-cfc1-4c72-be88-5d0e7cc9a3f0", nil).ExtractErr()
+	th.AssertNoErr(t, err)
+}
diff --git a/openstack/cdn/v1/services/testing/doc.go b/openstack/cdn/v1/services/testing/doc.go
new file mode 100644
index 0000000..7603f83
--- /dev/null
+++ b/openstack/cdn/v1/services/testing/doc.go
@@ -0,0 +1 @@
+package testing
diff --git a/openstack/cdn/v1/services/fixtures.go b/openstack/cdn/v1/services/testing/fixtures.go
similarity index 99%
rename from openstack/cdn/v1/services/fixtures.go
rename to openstack/cdn/v1/services/testing/fixtures.go
index 12d260e..d4093e0 100644
--- a/openstack/cdn/v1/services/fixtures.go
+++ b/openstack/cdn/v1/services/testing/fixtures.go
@@ -1,6 +1,4 @@
-// +build fixtures
-
-package services
+package testing
 
 import (
 	"fmt"
diff --git a/openstack/cdn/v1/services/requests_test.go b/openstack/cdn/v1/services/testing/requests_test.go
similarity index 66%
rename from openstack/cdn/v1/services/requests_test.go
rename to openstack/cdn/v1/services/testing/requests_test.go
index 1f27b59..0abc98e 100644
--- a/openstack/cdn/v1/services/requests_test.go
+++ b/openstack/cdn/v1/services/testing/requests_test.go
@@ -1,9 +1,10 @@
-package services
+package testing
 
 import (
 	"testing"
 
 	"github.com/gophercloud/gophercloud"
+	"github.com/gophercloud/gophercloud/openstack/cdn/v1/services"
 	"github.com/gophercloud/gophercloud/pagination"
 	th "github.com/gophercloud/gophercloud/testhelper"
 	fake "github.com/gophercloud/gophercloud/testhelper/client"
@@ -17,61 +18,61 @@
 
 	count := 0
 
-	err := List(fake.ServiceClient(), &ListOpts{}).EachPage(func(page pagination.Page) (bool, error) {
+	err := services.List(fake.ServiceClient(), &services.ListOpts{}).EachPage(func(page pagination.Page) (bool, error) {
 		count++
-		actual, err := ExtractServices(page)
+		actual, err := services.ExtractServices(page)
 		if err != nil {
 			t.Errorf("Failed to extract services: %v", err)
 			return false, err
 		}
 
-		expected := []Service{
-			Service{
+		expected := []services.Service{
+			{
 				ID:   "96737ae3-cfc1-4c72-be88-5d0e7cc9a3f0",
 				Name: "mywebsite.com",
-				Domains: []Domain{
-					Domain{
+				Domains: []services.Domain{
+					{
 						Domain: "www.mywebsite.com",
 					},
 				},
-				Origins: []Origin{
-					Origin{
+				Origins: []services.Origin{
+					{
 						Origin: "mywebsite.com",
 						Port:   80,
 						SSL:    false,
 					},
 				},
-				Caching: []CacheRule{
-					CacheRule{
+				Caching: []services.CacheRule{
+					{
 						Name: "default",
 						TTL:  3600,
 					},
-					CacheRule{
+					{
 						Name: "home",
 						TTL:  17200,
-						Rules: []TTLRule{
-							TTLRule{
+						Rules: []services.TTLRule{
+							{
 								Name:       "index",
 								RequestURL: "/index.htm",
 							},
 						},
 					},
-					CacheRule{
+					{
 						Name: "images",
 						TTL:  12800,
-						Rules: []TTLRule{
-							TTLRule{
+						Rules: []services.TTLRule{
+							{
 								Name:       "images",
 								RequestURL: "*.png",
 							},
 						},
 					},
 				},
-				Restrictions: []Restriction{
-					Restriction{
+				Restrictions: []services.Restriction{
+					{
 						Name: "website only",
-						Rules: []RestrictionRule{
-							RestrictionRule{
+						Rules: []services.RestrictionRule{
+							{
 								Name:     "mywebsite.com",
 								Referrer: "www.mywebsite.com",
 							},
@@ -80,55 +81,55 @@
 				},
 				FlavorID: "asia",
 				Status:   "deployed",
-				Errors:   []Error{},
+				Errors:   []services.Error{},
 				Links: []gophercloud.Link{
-					gophercloud.Link{
+					{
 						Href: "https://www.poppycdn.io/v1.0/services/96737ae3-cfc1-4c72-be88-5d0e7cc9a3f0",
 						Rel:  "self",
 					},
-					gophercloud.Link{
+					{
 						Href: "mywebsite.com.cdn123.poppycdn.net",
 						Rel:  "access_url",
 					},
-					gophercloud.Link{
+					{
 						Href: "https://www.poppycdn.io/v1.0/flavors/asia",
 						Rel:  "flavor",
 					},
 				},
 			},
-			Service{
+			{
 				ID:   "96737ae3-cfc1-4c72-be88-5d0e7cc9a3f1",
 				Name: "myothersite.com",
-				Domains: []Domain{
-					Domain{
+				Domains: []services.Domain{
+					{
 						Domain: "www.myothersite.com",
 					},
 				},
-				Origins: []Origin{
-					Origin{
+				Origins: []services.Origin{
+					{
 						Origin: "44.33.22.11",
 						Port:   80,
 						SSL:    false,
 					},
-					Origin{
+					{
 						Origin: "77.66.55.44",
 						Port:   80,
 						SSL:    false,
-						Rules: []OriginRule{
-							OriginRule{
+						Rules: []services.OriginRule{
+							{
 								Name:       "videos",
 								RequestURL: "^/videos/*.m3u",
 							},
 						},
 					},
 				},
-				Caching: []CacheRule{
-					CacheRule{
+				Caching: []services.CacheRule{
+					{
 						Name: "default",
 						TTL:  3600,
 					},
 				},
-				Restrictions: []Restriction{},
+				Restrictions: []services.Restriction{},
 				FlavorID:     "europe",
 				Status:       "deployed",
 				Links: []gophercloud.Link{
@@ -165,36 +166,36 @@
 
 	HandleCreateCDNServiceSuccessfully(t)
 
-	createOpts := CreateOpts{
+	createOpts := services.CreateOpts{
 		Name: "mywebsite.com",
-		Domains: []Domain{
-			Domain{
+		Domains: []services.Domain{
+			{
 				Domain: "www.mywebsite.com",
 			},
-			Domain{
+			{
 				Domain: "blog.mywebsite.com",
 			},
 		},
-		Origins: []Origin{
-			Origin{
+		Origins: []services.Origin{
+			{
 				Origin: "mywebsite.com",
 				Port:   80,
 				SSL:    false,
 			},
 		},
-		Restrictions: []Restriction{
-			Restriction{
+		Restrictions: []services.Restriction{
+			{
 				Name: "website only",
-				Rules: []RestrictionRule{
-					RestrictionRule{
+				Rules: []services.RestrictionRule{
+					{
 						Name:     "mywebsite.com",
 						Referrer: "www.mywebsite.com",
 					},
 				},
 			},
 		},
-		Caching: []CacheRule{
-			CacheRule{
+		Caching: []services.CacheRule{
+			{
 				Name: "default",
 				TTL:  3600,
 			},
@@ -203,7 +204,7 @@
 	}
 
 	expected := "https://global.cdn.api.rackspacecloud.com/v1.0/services/96737ae3-cfc1-4c72-be88-5d0e7cc9a3f0"
-	actual, err := Create(fake.ServiceClient(), createOpts).Extract()
+	actual, err := services.Create(fake.ServiceClient(), createOpts).Extract()
 	th.AssertNoErr(t, err)
 	th.AssertEquals(t, expected, actual)
 }
@@ -214,53 +215,53 @@
 
 	HandleGetCDNServiceSuccessfully(t)
 
-	expected := &Service{
+	expected := &services.Service{
 		ID:   "96737ae3-cfc1-4c72-be88-5d0e7cc9a3f0",
 		Name: "mywebsite.com",
-		Domains: []Domain{
-			Domain{
+		Domains: []services.Domain{
+			{
 				Domain:   "www.mywebsite.com",
 				Protocol: "http",
 			},
 		},
-		Origins: []Origin{
-			Origin{
+		Origins: []services.Origin{
+			{
 				Origin: "mywebsite.com",
 				Port:   80,
 				SSL:    false,
 			},
 		},
-		Caching: []CacheRule{
-			CacheRule{
+		Caching: []services.CacheRule{
+			{
 				Name: "default",
 				TTL:  3600,
 			},
-			CacheRule{
+			{
 				Name: "home",
 				TTL:  17200,
-				Rules: []TTLRule{
-					TTLRule{
+				Rules: []services.TTLRule{
+					{
 						Name:       "index",
 						RequestURL: "/index.htm",
 					},
 				},
 			},
-			CacheRule{
+			{
 				Name: "images",
 				TTL:  12800,
-				Rules: []TTLRule{
-					TTLRule{
+				Rules: []services.TTLRule{
+					{
 						Name:       "images",
 						RequestURL: "*.png",
 					},
 				},
 			},
 		},
-		Restrictions: []Restriction{
-			Restriction{
+		Restrictions: []services.Restriction{
+			{
 				Name: "website only",
-				Rules: []RestrictionRule{
-					RestrictionRule{
+				Rules: []services.RestrictionRule{
+					{
 						Name:     "mywebsite.com",
 						Referrer: "www.mywebsite.com",
 					},
@@ -269,24 +270,24 @@
 		},
 		FlavorID: "cdn",
 		Status:   "deployed",
-		Errors:   []Error{},
+		Errors:   []services.Error{},
 		Links: []gophercloud.Link{
-			gophercloud.Link{
+			{
 				Href: "https://global.cdn.api.rackspacecloud.com/v1.0/110011/services/96737ae3-cfc1-4c72-be88-5d0e7cc9a3f0",
 				Rel:  "self",
 			},
-			gophercloud.Link{
+			{
 				Href: "blog.mywebsite.com.cdn1.raxcdn.com",
 				Rel:  "access_url",
 			},
-			gophercloud.Link{
+			{
 				Href: "https://global.cdn.api.rackspacecloud.com/v1.0/110011/flavors/cdn",
 				Rel:  "flavor",
 			},
 		},
 	}
 
-	actual, err := Get(fake.ServiceClient(), "96737ae3-cfc1-4c72-be88-5d0e7cc9a3f0").Extract()
+	actual, err := services.Get(fake.ServiceClient(), "96737ae3-cfc1-4c72-be88-5d0e7cc9a3f0").Extract()
 	th.AssertNoErr(t, err)
 	th.AssertDeepEquals(t, expected, actual)
 }
@@ -298,51 +299,51 @@
 	HandleUpdateCDNServiceSuccessfully(t)
 
 	expected := "https://www.poppycdn.io/v1.0/services/96737ae3-cfc1-4c72-be88-5d0e7cc9a3f0"
-	ops := UpdateOpts{
+	ops := services.UpdateOpts{
 		// Append a single Domain
-		Append{Value: Domain{Domain: "appended.mocksite4.com"}},
+		services.Append{Value: services.Domain{Domain: "appended.mocksite4.com"}},
 		// Insert a single Domain
-		Insertion{
+		services.Insertion{
 			Index: 4,
-			Value: Domain{Domain: "inserted.mocksite4.com"},
+			Value: services.Domain{Domain: "inserted.mocksite4.com"},
 		},
 		// Bulk addition
-		Append{
-			Value: DomainList{
-				Domain{Domain: "bulkadded1.mocksite4.com"},
-				Domain{Domain: "bulkadded2.mocksite4.com"},
+		services.Append{
+			Value: services.DomainList{
+				{Domain: "bulkadded1.mocksite4.com"},
+				{Domain: "bulkadded2.mocksite4.com"},
 			},
 		},
 		// Replace a single Origin
-		Replacement{
+		services.Replacement{
 			Index: 2,
-			Value: Origin{Origin: "44.33.22.11", Port: 80, SSL: false},
+			Value: services.Origin{Origin: "44.33.22.11", Port: 80, SSL: false},
 		},
 		// Bulk replace Origins
-		Replacement{
+		services.Replacement{
 			Index: 0, // Ignored
-			Value: OriginList{
-				Origin{Origin: "44.33.22.11", Port: 80, SSL: false},
-				Origin{Origin: "55.44.33.22", Port: 443, SSL: true},
+			Value: services.OriginList{
+				{Origin: "44.33.22.11", Port: 80, SSL: false},
+				{Origin: "55.44.33.22", Port: 443, SSL: true},
 			},
 		},
 		// Remove a single CacheRule
-		Removal{
+		services.Removal{
 			Index: 8,
-			Path:  PathCaching,
+			Path:  services.PathCaching,
 		},
 		// Bulk removal
-		Removal{
+		services.Removal{
 			All:  true,
-			Path: PathCaching,
+			Path: services.PathCaching,
 		},
 		// Service name replacement
-		NameReplacement{
+		services.NameReplacement{
 			NewName: "differentServiceName",
 		},
 	}
 
-	actual, err := Update(fake.ServiceClient(), "96737ae3-cfc1-4c72-be88-5d0e7cc9a3f0", ops).Extract()
+	actual, err := services.Update(fake.ServiceClient(), "96737ae3-cfc1-4c72-be88-5d0e7cc9a3f0", ops).Extract()
 	th.AssertNoErr(t, err)
 	th.AssertEquals(t, expected, actual)
 }
@@ -353,6 +354,6 @@
 
 	HandleDeleteCDNServiceSuccessfully(t)
 
-	err := Delete(fake.ServiceClient(), "96737ae3-cfc1-4c72-be88-5d0e7cc9a3f0").ExtractErr()
+	err := services.Delete(fake.ServiceClient(), "96737ae3-cfc1-4c72-be88-5d0e7cc9a3f0").ExtractErr()
 	th.AssertNoErr(t, err)
 }