move unit tests into 'testing' directories
diff --git a/openstack/identity/v3/endpoints/testing/doc.go b/openstack/identity/v3/endpoints/testing/doc.go
new file mode 100644
index 0000000..7603f83
--- /dev/null
+++ b/openstack/identity/v3/endpoints/testing/doc.go
@@ -0,0 +1 @@
+package testing
diff --git a/openstack/identity/v3/endpoints/requests_test.go b/openstack/identity/v3/endpoints/testing/requests_test.go
similarity index 88%
rename from openstack/identity/v3/endpoints/requests_test.go
rename to openstack/identity/v3/endpoints/testing/requests_test.go
index 14bbe6a..53d8488 100644
--- a/openstack/identity/v3/endpoints/requests_test.go
+++ b/openstack/identity/v3/endpoints/testing/requests_test.go
@@ -1,4 +1,4 @@
-package endpoints
+package testing
import (
"fmt"
@@ -6,6 +6,7 @@
"testing"
"github.com/gophercloud/gophercloud"
+ "github.com/gophercloud/gophercloud/openstack/identity/v3/endpoints"
"github.com/gophercloud/gophercloud/pagination"
th "github.com/gophercloud/gophercloud/testhelper"
"github.com/gophercloud/gophercloud/testhelper/client"
@@ -48,7 +49,7 @@
`)
})
- actual, err := Create(client.ServiceClient(), CreateOpts{
+ actual, err := endpoints.Create(client.ServiceClient(), endpoints.CreateOpts{
Availability: gophercloud.AvailabilityPublic,
Name: "the-endiest-of-points",
Region: "underground",
@@ -57,7 +58,7 @@
}).Extract()
th.AssertNoErr(t, err)
- expected := &Endpoint{
+ expected := &endpoints.Endpoint{
ID: "12",
Availability: gophercloud.AvailabilityPublic,
Name: "the-endiest-of-points",
@@ -113,16 +114,16 @@
})
count := 0
- List(client.ServiceClient(), ListOpts{}).EachPage(func(page pagination.Page) (bool, error) {
+ endpoints.List(client.ServiceClient(), endpoints.ListOpts{}).EachPage(func(page pagination.Page) (bool, error) {
count++
- actual, err := ExtractEndpoints(page)
+ actual, err := endpoints.ExtractEndpoints(page)
if err != nil {
t.Errorf("Failed to extract endpoints: %v", err)
return false, err
}
- expected := []Endpoint{
- Endpoint{
+ expected := []endpoints.Endpoint{
+ {
ID: "12",
Availability: gophercloud.AvailabilityPublic,
Name: "the-endiest-of-points",
@@ -130,7 +131,7 @@
ServiceID: "asdfasdfasdfasdf",
URL: "https://1.2.3.4:9000/",
},
- Endpoint{
+ {
ID: "13",
Availability: gophercloud.AvailabilityInternal,
Name: "shhhh",
@@ -178,7 +179,7 @@
`)
})
- actual, err := Update(client.ServiceClient(), "12", UpdateOpts{
+ actual, err := endpoints.Update(client.ServiceClient(), "12", endpoints.UpdateOpts{
Name: "renamed",
Region: "somewhere-else",
}).Extract()
@@ -186,7 +187,7 @@
t.Fatalf("Unexpected error from Update: %v", err)
}
- expected := &Endpoint{
+ expected := &endpoints.Endpoint{
ID: "12",
Availability: gophercloud.AvailabilityPublic,
Name: "renamed",
@@ -208,6 +209,6 @@
w.WriteHeader(http.StatusNoContent)
})
- res := Delete(client.ServiceClient(), "34")
+ res := endpoints.Delete(client.ServiceClient(), "34")
th.AssertNoErr(t, res.Err)
}