move unit tests into 'testing' directories
diff --git a/openstack/identity/v3/services/testing/doc.go b/openstack/identity/v3/services/testing/doc.go
new file mode 100644
index 0000000..7603f83
--- /dev/null
+++ b/openstack/identity/v3/services/testing/doc.go
@@ -0,0 +1 @@
+package testing
diff --git a/openstack/identity/v3/services/requests_test.go b/openstack/identity/v3/services/testing/requests_test.go
similarity index 84%
rename from openstack/identity/v3/services/requests_test.go
rename to openstack/identity/v3/services/testing/requests_test.go
index aa19bcc..0a065a2 100644
--- a/openstack/identity/v3/services/requests_test.go
+++ b/openstack/identity/v3/services/testing/requests_test.go
@@ -1,10 +1,11 @@
-package services
+package testing
import (
"fmt"
"net/http"
"testing"
+ "github.com/gophercloud/gophercloud/openstack/identity/v3/services"
"github.com/gophercloud/gophercloud/pagination"
th "github.com/gophercloud/gophercloud/testhelper"
"github.com/gophercloud/gophercloud/testhelper/client"
@@ -31,14 +32,14 @@
}`)
})
- expected := &Service{
+ expected := &services.Service{
Description: "Here's your service",
ID: "1234",
Name: "InscrutableOpenStackProjectName",
Type: "compute",
}
- actual, err := Create(client.ServiceClient(), "compute").Extract()
+ actual, err := services.Create(client.ServiceClient(), "compute").Extract()
if err != nil {
t.Fatalf("Unexpected error from Create: %v", err)
}
@@ -79,21 +80,21 @@
})
count := 0
- err := List(client.ServiceClient(), ListOpts{}).EachPage(func(page pagination.Page) (bool, error) {
+ err := services.List(client.ServiceClient(), services.ListOpts{}).EachPage(func(page pagination.Page) (bool, error) {
count++
- actual, err := ExtractServices(page)
+ actual, err := services.ExtractServices(page)
if err != nil {
return false, err
}
- expected := []Service{
- Service{
+ expected := []services.Service{
+ {
Description: "Service One",
ID: "1234",
Name: "service-one",
Type: "identity",
},
- Service{
+ {
Description: "Service Two",
ID: "9876",
Name: "service-two",
@@ -128,10 +129,10 @@
`)
})
- actual, err := Get(client.ServiceClient(), "12345").Extract()
+ actual, err := services.Get(client.ServiceClient(), "12345").Extract()
th.AssertNoErr(t, err)
- expected := &Service{
+ expected := &services.Service{
ID: "12345",
Description: "Service One",
Name: "service-one",
@@ -161,12 +162,12 @@
`)
})
- expected := &Service{
+ expected := &services.Service{
ID: "12345",
Type: "lasermagic",
}
- actual, err := Update(client.ServiceClient(), "12345", "lasermagic").Extract()
+ actual, err := services.Update(client.ServiceClient(), "12345", "lasermagic").Extract()
th.AssertNoErr(t, err)
th.AssertDeepEquals(t, expected, actual)
}
@@ -181,6 +182,6 @@
w.WriteHeader(http.StatusNoContent)
})
- res := Delete(client.ServiceClient(), "12345")
+ res := services.Delete(client.ServiceClient(), "12345")
th.AssertNoErr(t, res.Err)
}