move unit tests into 'testing' directories
diff --git a/openstack/identity/v2/extensions/admin/roles/testing/doc.go b/openstack/identity/v2/extensions/admin/roles/testing/doc.go
new file mode 100644
index 0000000..7603f83
--- /dev/null
+++ b/openstack/identity/v2/extensions/admin/roles/testing/doc.go
@@ -0,0 +1 @@
+package testing
diff --git a/openstack/identity/v2/extensions/admin/roles/fixtures.go b/openstack/identity/v2/extensions/admin/roles/testing/fixtures.go
similarity index 97%
rename from openstack/identity/v2/extensions/admin/roles/fixtures.go
rename to openstack/identity/v2/extensions/admin/roles/testing/fixtures.go
index 6b11f5c..498c161 100644
--- a/openstack/identity/v2/extensions/admin/roles/fixtures.go
+++ b/openstack/identity/v2/extensions/admin/roles/testing/fixtures.go
@@ -1,6 +1,4 @@
-// +build fixtures
-
-package roles
+package testing
 
 import (
 	"fmt"
diff --git a/openstack/identity/v2/extensions/admin/roles/requests_test.go b/openstack/identity/v2/extensions/admin/roles/testing/requests_test.go
similarity index 65%
rename from openstack/identity/v2/extensions/admin/roles/requests_test.go
rename to openstack/identity/v2/extensions/admin/roles/testing/requests_test.go
index cf3402d..8cf5395 100644
--- a/openstack/identity/v2/extensions/admin/roles/requests_test.go
+++ b/openstack/identity/v2/extensions/admin/roles/testing/requests_test.go
@@ -1,8 +1,9 @@
-package roles
+package testing
 
 import (
 	"testing"
 
+	"github.com/gophercloud/gophercloud/openstack/identity/v2/extensions/admin/roles"
 	"github.com/gophercloud/gophercloud/pagination"
 	th "github.com/gophercloud/gophercloud/testhelper"
 	"github.com/gophercloud/gophercloud/testhelper/client"
@@ -16,16 +17,16 @@
 
 	count := 0
 
-	err := List(client.ServiceClient()).EachPage(func(page pagination.Page) (bool, error) {
+	err := roles.List(client.ServiceClient()).EachPage(func(page pagination.Page) (bool, error) {
 		count++
-		actual, err := ExtractRoles(page)
+		actual, err := roles.ExtractRoles(page)
 		if err != nil {
 			t.Errorf("Failed to extract users: %v", err)
 			return false, err
 		}
 
-		expected := []Role{
-			Role{
+		expected := []roles.Role{
+			{
 				ID:          "123",
 				Name:        "compute:admin",
 				Description: "Nova Administrator",
@@ -47,7 +48,7 @@
 
 	MockAddUserRoleResponse(t)
 
-	err := AddUser(client.ServiceClient(), "{tenant_id}", "{user_id}", "{role_id}").ExtractErr()
+	err := roles.AddUser(client.ServiceClient(), "{tenant_id}", "{user_id}", "{role_id}").ExtractErr()
 
 	th.AssertNoErr(t, err)
 }
@@ -58,7 +59,7 @@
 
 	MockDeleteUserRoleResponse(t)
 
-	err := DeleteUser(client.ServiceClient(), "{tenant_id}", "{user_id}", "{role_id}").ExtractErr()
+	err := roles.DeleteUser(client.ServiceClient(), "{tenant_id}", "{user_id}", "{role_id}").ExtractErr()
 
 	th.AssertNoErr(t, err)
 }
diff --git a/openstack/identity/v2/extensions/delegate_test.go b/openstack/identity/v2/extensions/testing/delegate_test.go
similarity index 69%
rename from openstack/identity/v2/extensions/delegate_test.go
rename to openstack/identity/v2/extensions/testing/delegate_test.go
index b425130..e7869d8 100644
--- a/openstack/identity/v2/extensions/delegate_test.go
+++ b/openstack/identity/v2/extensions/testing/delegate_test.go
@@ -1,9 +1,10 @@
-package extensions
+package testing
 
 import (
 	"testing"
 
-	common "github.com/gophercloud/gophercloud/openstack/common/extensions"
+	common "github.com/gophercloud/gophercloud/openstack/common/extensions/testing"
+	"github.com/gophercloud/gophercloud/openstack/identity/v2/extensions"
 	"github.com/gophercloud/gophercloud/pagination"
 	th "github.com/gophercloud/gophercloud/testhelper"
 	"github.com/gophercloud/gophercloud/testhelper/client"
@@ -15,9 +16,9 @@
 	HandleListExtensionsSuccessfully(t)
 
 	count := 0
-	err := List(client.ServiceClient()).EachPage(func(page pagination.Page) (bool, error) {
+	err := extensions.List(client.ServiceClient()).EachPage(func(page pagination.Page) (bool, error) {
 		count++
-		actual, err := ExtractExtensions(page)
+		actual, err := extensions.ExtractExtensions(page)
 		th.AssertNoErr(t, err)
 		th.CheckDeepEquals(t, common.ExpectedExtensions, actual)
 
@@ -32,7 +33,7 @@
 	defer th.TeardownHTTP()
 	common.HandleGetExtensionSuccessfully(t)
 
-	actual, err := Get(client.ServiceClient(), "agent").Extract()
+	actual, err := extensions.Get(client.ServiceClient(), "agent").Extract()
 	th.AssertNoErr(t, err)
 	th.CheckDeepEquals(t, common.SingleExtension, actual)
 }
diff --git a/openstack/identity/v2/extensions/testing/doc.go b/openstack/identity/v2/extensions/testing/doc.go
new file mode 100644
index 0000000..7603f83
--- /dev/null
+++ b/openstack/identity/v2/extensions/testing/doc.go
@@ -0,0 +1 @@
+package testing
diff --git a/openstack/identity/v2/extensions/fixtures.go b/openstack/identity/v2/extensions/testing/fixtures.go
similarity index 97%
rename from openstack/identity/v2/extensions/fixtures.go
rename to openstack/identity/v2/extensions/testing/fixtures.go
index 3fd5ad9..60afb74 100644
--- a/openstack/identity/v2/extensions/fixtures.go
+++ b/openstack/identity/v2/extensions/testing/fixtures.go
@@ -1,6 +1,4 @@
-// +build fixtures
-
-package extensions
+package testing
 
 import (
 	"fmt"
diff --git a/openstack/identity/v2/tenants/testing/doc.go b/openstack/identity/v2/tenants/testing/doc.go
new file mode 100644
index 0000000..7603f83
--- /dev/null
+++ b/openstack/identity/v2/tenants/testing/doc.go
@@ -0,0 +1 @@
+package testing
diff --git a/openstack/identity/v2/tenants/fixtures.go b/openstack/identity/v2/tenants/testing/fixtures.go
similarity index 86%
rename from openstack/identity/v2/tenants/fixtures.go
rename to openstack/identity/v2/tenants/testing/fixtures.go
index 3ccc791..7ddba45 100644
--- a/openstack/identity/v2/tenants/fixtures.go
+++ b/openstack/identity/v2/tenants/testing/fixtures.go
@@ -1,12 +1,11 @@
-// +build fixtures
-
-package tenants
+package testing
 
 import (
 	"fmt"
 	"net/http"
 	"testing"
 
+	"github.com/gophercloud/gophercloud/openstack/identity/v2/tenants"
 	th "github.com/gophercloud/gophercloud/testhelper"
 	"github.com/gophercloud/gophercloud/testhelper/client"
 )
@@ -32,7 +31,7 @@
 `
 
 // RedTeam is a Tenant fixture.
-var RedTeam = Tenant{
+var RedTeam = tenants.Tenant{
 	ID:          "1234",
 	Name:        "Red Team",
 	Description: "The team that is red",
@@ -40,7 +39,7 @@
 }
 
 // BlueTeam is a Tenant fixture.
-var BlueTeam = Tenant{
+var BlueTeam = tenants.Tenant{
 	ID:          "9876",
 	Name:        "Blue Team",
 	Description: "The team that is blue",
@@ -48,7 +47,7 @@
 }
 
 // ExpectedTenantSlice is the slice of tenants expected to be returned from ListOutput.
-var ExpectedTenantSlice = []Tenant{RedTeam, BlueTeam}
+var ExpectedTenantSlice = []tenants.Tenant{RedTeam, BlueTeam}
 
 // HandleListTenantsSuccessfully creates an HTTP handler at `/tenants` on the test handler mux that
 // responds with a list of two tenants.
diff --git a/openstack/identity/v2/tenants/requests_test.go b/openstack/identity/v2/tenants/testing/requests_test.go
similarity index 67%
rename from openstack/identity/v2/tenants/requests_test.go
rename to openstack/identity/v2/tenants/testing/requests_test.go
index d7a4db0..2a9b71c 100644
--- a/openstack/identity/v2/tenants/requests_test.go
+++ b/openstack/identity/v2/tenants/testing/requests_test.go
@@ -1,8 +1,9 @@
-package tenants
+package testing
 
 import (
 	"testing"
 
+	"github.com/gophercloud/gophercloud/openstack/identity/v2/tenants"
 	"github.com/gophercloud/gophercloud/pagination"
 	th "github.com/gophercloud/gophercloud/testhelper"
 	"github.com/gophercloud/gophercloud/testhelper/client"
@@ -14,10 +15,10 @@
 	HandleListTenantsSuccessfully(t)
 
 	count := 0
-	err := List(client.ServiceClient(), nil).EachPage(func(page pagination.Page) (bool, error) {
+	err := tenants.List(client.ServiceClient(), nil).EachPage(func(page pagination.Page) (bool, error) {
 		count++
 
-		actual, err := ExtractTenants(page)
+		actual, err := tenants.ExtractTenants(page)
 		th.AssertNoErr(t, err)
 
 		th.CheckDeepEquals(t, ExpectedTenantSlice, actual)
diff --git a/openstack/identity/v2/tokens/testing/doc.go b/openstack/identity/v2/tokens/testing/doc.go
new file mode 100644
index 0000000..7603f83
--- /dev/null
+++ b/openstack/identity/v2/tokens/testing/doc.go
@@ -0,0 +1 @@
+package testing
diff --git a/openstack/identity/v2/tokens/fixtures.go b/openstack/identity/v2/tokens/testing/fixtures.go
similarity index 86%
rename from openstack/identity/v2/tokens/fixtures.go
rename to openstack/identity/v2/tokens/testing/fixtures.go
index 85a9571..d3a8f24 100644
--- a/openstack/identity/v2/tokens/fixtures.go
+++ b/openstack/identity/v2/tokens/testing/fixtures.go
@@ -1,6 +1,4 @@
-// +build fixtures
-
-package tokens
+package testing
 
 import (
 	"fmt"
@@ -9,12 +7,13 @@
 	"time"
 
 	"github.com/gophercloud/gophercloud/openstack/identity/v2/tenants"
+	"github.com/gophercloud/gophercloud/openstack/identity/v2/tokens"
 	th "github.com/gophercloud/gophercloud/testhelper"
 	thclient "github.com/gophercloud/gophercloud/testhelper/client"
 )
 
 // ExpectedToken is the token that should be parsed from TokenCreationResponse.
-var ExpectedToken = &Token{
+var ExpectedToken = &tokens.Token{
 	ID:        "aaaabbbbccccdddd",
 	ExpiresAt: time.Date(2014, time.January, 31, 15, 30, 58, 0, time.UTC),
 	Tenant: tenants.Tenant{
@@ -26,27 +25,27 @@
 }
 
 // ExpectedServiceCatalog is the service catalog that should be parsed from TokenCreationResponse.
-var ExpectedServiceCatalog = &ServiceCatalog{
-	Entries: []CatalogEntry{
-		CatalogEntry{
+var ExpectedServiceCatalog = &tokens.ServiceCatalog{
+	Entries: []tokens.CatalogEntry{
+		{
 			Name: "inscrutablewalrus",
 			Type: "something",
-			Endpoints: []Endpoint{
-				Endpoint{
+			Endpoints: []tokens.Endpoint{
+				{
 					PublicURL: "http://something0:1234/v2/",
 					Region:    "region0",
 				},
-				Endpoint{
+				{
 					PublicURL: "http://something1:1234/v2/",
 					Region:    "region1",
 				},
 			},
 		},
-		CatalogEntry{
+		{
 			Name: "arbitrarypenguin",
 			Type: "else",
-			Endpoints: []Endpoint{
-				Endpoint{
+			Endpoints: []tokens.Endpoint{
+				{
 					PublicURL: "http://else0:4321/v3/",
 					Region:    "region0",
 				},
@@ -56,10 +55,10 @@
 }
 
 // ExpectedUser is the token that should be parsed from TokenGetResponse.
-var ExpectedUser = &User{
+var ExpectedUser = &tokens.User{
 	ID:       "a530fefc3d594c4ba2693a4ecd6be74e",
 	Name:     "apiserver",
-	Roles:    []Role{{"member"}, {"service"}},
+	Roles:    []tokens.Role{{"member"}, {"service"}},
 	UserName: "apiserver",
 }
 
@@ -123,19 +122,19 @@
 				"name": "test"
 			}
 		},
-        "serviceCatalog": [], 
+        "serviceCatalog": [],
 		"user": {
-            "id": "a530fefc3d594c4ba2693a4ecd6be74e", 
-            "name": "apiserver", 
+            "id": "a530fefc3d594c4ba2693a4ecd6be74e",
+            "name": "apiserver",
             "roles": [
                 {
                     "name": "member"
-                }, 
+                },
                 {
                     "name": "service"
                 }
-            ], 
-            "roles_links": [], 
+            ],
+            "roles_links": [],
             "username": "apiserver"
         }
     }
@@ -172,7 +171,7 @@
 
 // IsSuccessful ensures that a CreateResult was successful and contains the correct token and
 // service catalog.
-func IsSuccessful(t *testing.T, result CreateResult) {
+func IsSuccessful(t *testing.T, result tokens.CreateResult) {
 	token, err := result.ExtractToken()
 	th.AssertNoErr(t, err)
 	th.CheckDeepEquals(t, ExpectedToken, token)
@@ -184,7 +183,7 @@
 
 // GetIsSuccessful ensures that a GetResult was successful and contains the correct token and
 // User Info.
-func GetIsSuccessful(t *testing.T, result GetResult) {
+func GetIsSuccessful(t *testing.T, result tokens.GetResult) {
 	token, err := result.ExtractToken()
 	th.AssertNoErr(t, err)
 	th.CheckDeepEquals(t, ExpectedToken, token)
diff --git a/openstack/identity/v2/tokens/requests_test.go b/openstack/identity/v2/tokens/testing/requests_test.go
similarity index 84%
rename from openstack/identity/v2/tokens/requests_test.go
rename to openstack/identity/v2/tokens/testing/requests_test.go
index a6d16f3..b687a92 100644
--- a/openstack/identity/v2/tokens/requests_test.go
+++ b/openstack/identity/v2/tokens/testing/requests_test.go
@@ -1,19 +1,20 @@
-package tokens
+package testing
 
 import (
 	"testing"
 
 	"github.com/gophercloud/gophercloud"
+	"github.com/gophercloud/gophercloud/openstack/identity/v2/tokens"
 	th "github.com/gophercloud/gophercloud/testhelper"
 	"github.com/gophercloud/gophercloud/testhelper/client"
 )
 
-func tokenPost(t *testing.T, options gophercloud.AuthOptions, requestJSON string) CreateResult {
+func tokenPost(t *testing.T, options gophercloud.AuthOptions, requestJSON string) tokens.CreateResult {
 	th.SetupHTTP()
 	defer th.TeardownHTTP()
 	HandleTokenPost(t, requestJSON)
 
-	return Create(client.ServiceClient(), options)
+	return tokens.Create(client.ServiceClient(), options)
 }
 
 func tokenPostErr(t *testing.T, options gophercloud.AuthOptions, expectedErr error) {
@@ -21,7 +22,7 @@
 	defer th.TeardownHTTP()
 	HandleTokenPost(t, "")
 
-	actualErr := Create(client.ServiceClient(), options).Err
+	actualErr := tokens.Create(client.ServiceClient(), options).Err
 	th.CheckDeepEquals(t, expectedErr, actualErr)
 }
 
@@ -91,11 +92,11 @@
 	tokenPostErr(t, options, gophercloud.ErrMissingInput{Argument: "Username"})
 }
 
-func tokenGet(t *testing.T, tokenId string) GetResult {
+func tokenGet(t *testing.T, tokenId string) tokens.GetResult {
 	th.SetupHTTP()
 	defer th.TeardownHTTP()
 	HandleTokenGet(t, tokenId)
-	return Get(client.ServiceClient(), tokenId)
+	return tokens.Get(client.ServiceClient(), tokenId)
 }
 
 func TestGetWithToken(t *testing.T) {
diff --git a/openstack/identity/v2/users/testing/doc.go b/openstack/identity/v2/users/testing/doc.go
new file mode 100644
index 0000000..7603f83
--- /dev/null
+++ b/openstack/identity/v2/users/testing/doc.go
@@ -0,0 +1 @@
+package testing
diff --git a/openstack/identity/v2/users/fixtures.go b/openstack/identity/v2/users/testing/fixtures.go
similarity index 98%
rename from openstack/identity/v2/users/fixtures.go
rename to openstack/identity/v2/users/testing/fixtures.go
index 7b0bc4c..c1c3b89 100644
--- a/openstack/identity/v2/users/fixtures.go
+++ b/openstack/identity/v2/users/testing/fixtures.go
@@ -1,6 +1,4 @@
-// +build fixtures
-
-package users
+package testing
 
 import (
 	"fmt"
diff --git a/openstack/identity/v2/users/requests_test.go b/openstack/identity/v2/users/testing/requests_test.go
similarity index 71%
rename from openstack/identity/v2/users/requests_test.go
rename to openstack/identity/v2/users/testing/requests_test.go
index 0e6da37..3cb047e 100644
--- a/openstack/identity/v2/users/requests_test.go
+++ b/openstack/identity/v2/users/testing/requests_test.go
@@ -1,9 +1,10 @@
-package users
+package testing
 
 import (
 	"testing"
 
 	"github.com/gophercloud/gophercloud"
+	"github.com/gophercloud/gophercloud/openstack/identity/v2/users"
 	"github.com/gophercloud/gophercloud/pagination"
 	th "github.com/gophercloud/gophercloud/testhelper"
 	"github.com/gophercloud/gophercloud/testhelper/client"
@@ -17,13 +18,13 @@
 
 	count := 0
 
-	err := List(client.ServiceClient()).EachPage(func(page pagination.Page) (bool, error) {
+	err := users.List(client.ServiceClient()).EachPage(func(page pagination.Page) (bool, error) {
 		count++
-		actual, err := ExtractUsers(page)
+		actual, err := users.ExtractUsers(page)
 		th.AssertNoErr(t, err)
 
-		expected := []User{
-			User{
+		expected := []users.User{
+			{
 				ID:       "u1000",
 				Name:     "John Smith",
 				Username: "jqsmith",
@@ -31,7 +32,7 @@
 				Enabled:  true,
 				TenantID: "12345",
 			},
-			User{
+			{
 				ID:       "u1001",
 				Name:     "Jane Smith",
 				Username: "jqsmith",
@@ -53,18 +54,18 @@
 
 	mockCreateUserResponse(t)
 
-	opts := CreateOpts{
+	opts := users.CreateOpts{
 		Name:     "new_user",
 		TenantID: "12345",
 		Enabled:  gophercloud.Disabled,
 		Email:    "new_user@foo.com",
 	}
 
-	user, err := Create(client.ServiceClient(), opts).Extract()
+	user, err := users.Create(client.ServiceClient(), opts).Extract()
 
 	th.AssertNoErr(t, err)
 
-	expected := &User{
+	expected := &users.User{
 		Name:     "new_user",
 		ID:       "c39e3de9be2d4c779f1dfd6abacc176d",
 		Email:    "new_user@foo.com",
@@ -81,10 +82,10 @@
 
 	mockGetUserResponse(t)
 
-	user, err := Get(client.ServiceClient(), "new_user").Extract()
+	user, err := users.Get(client.ServiceClient(), "new_user").Extract()
 	th.AssertNoErr(t, err)
 
-	expected := &User{
+	expected := &users.User{
 		Name:     "new_user",
 		ID:       "c39e3de9be2d4c779f1dfd6abacc176d",
 		Email:    "new_user@foo.com",
@@ -102,17 +103,17 @@
 	mockUpdateUserResponse(t)
 
 	id := "c39e3de9be2d4c779f1dfd6abacc176d"
-	opts := UpdateOpts{
+	opts := users.UpdateOpts{
 		Name:    "new_name",
 		Enabled: gophercloud.Enabled,
 		Email:   "new_email@foo.com",
 	}
 
-	user, err := Update(client.ServiceClient(), id, opts).Extract()
+	user, err := users.Update(client.ServiceClient(), id, opts).Extract()
 
 	th.AssertNoErr(t, err)
 
-	expected := &User{
+	expected := &users.User{
 		Name:     "new_name",
 		ID:       id,
 		Email:    "new_email@foo.com",
@@ -129,7 +130,7 @@
 
 	mockDeleteUserResponse(t)
 
-	res := Delete(client.ServiceClient(), "c39e3de9be2d4c779f1dfd6abacc176d")
+	res := users.Delete(client.ServiceClient(), "c39e3de9be2d4c779f1dfd6abacc176d")
 	th.AssertNoErr(t, res.Err)
 }
 
@@ -142,13 +143,13 @@
 	tenantID := "1d8b6120dcc640fda4fc9194ffc80273"
 	userID := "c39e3de9be2d4c779f1dfd6abacc176d"
 
-	err := ListRoles(client.ServiceClient(), tenantID, userID).EachPage(func(page pagination.Page) (bool, error) {
-		actual, err := ExtractRoles(page)
+	err := users.ListRoles(client.ServiceClient(), tenantID, userID).EachPage(func(page pagination.Page) (bool, error) {
+		actual, err := users.ExtractRoles(page)
 		th.AssertNoErr(t, err)
 
-		expected := []Role{
-			Role{ID: "9fe2ff9ee4384b1894a90878d3e92bab", Name: "foo_role"},
-			Role{ID: "1ea3d56793574b668e85960fbf651e13", Name: "admin"},
+		expected := []users.Role{
+			{ID: "9fe2ff9ee4384b1894a90878d3e92bab", Name: "foo_role"},
+			{ID: "1ea3d56793574b668e85960fbf651e13", Name: "admin"},
 		}
 
 		th.CheckDeepEquals(t, expected, actual)