move unit tests into 'testing' directories
diff --git a/openstack/compute/v2/flavors/testing/doc.go b/openstack/compute/v2/flavors/testing/doc.go
new file mode 100644
index 0000000..7603f83
--- /dev/null
+++ b/openstack/compute/v2/flavors/testing/doc.go
@@ -0,0 +1 @@
+package testing
diff --git a/openstack/compute/v2/flavors/requests_test.go b/openstack/compute/v2/flavors/testing/requests_test.go
similarity index 82%
rename from openstack/compute/v2/flavors/requests_test.go
rename to openstack/compute/v2/flavors/testing/requests_test.go
index 311dbf0..e86512a 100644
--- a/openstack/compute/v2/flavors/requests_test.go
+++ b/openstack/compute/v2/flavors/testing/requests_test.go
@@ -1,4 +1,4 @@
-package flavors
+package testing
import (
"fmt"
@@ -6,6 +6,7 @@
"reflect"
"testing"
+ "github.com/gophercloud/gophercloud/openstack/compute/v2/flavors"
"github.com/gophercloud/gophercloud/pagination"
th "github.com/gophercloud/gophercloud/testhelper"
fake "github.com/gophercloud/gophercloud/testhelper/client"
@@ -60,17 +61,17 @@
})
pages := 0
- err := ListDetail(fake.ServiceClient(), nil).EachPage(func(page pagination.Page) (bool, error) {
+ err := flavors.ListDetail(fake.ServiceClient(), nil).EachPage(func(page pagination.Page) (bool, error) {
pages++
- actual, err := ExtractFlavors(page)
+ actual, err := flavors.ExtractFlavors(page)
if err != nil {
return false, err
}
- expected := []Flavor{
- Flavor{ID: "1", Name: "m1.tiny", Disk: 1, RAM: 512, VCPUs: 1},
- Flavor{ID: "2", Name: "m2.small", Disk: 10, RAM: 1024, VCPUs: 2},
+ expected := []flavors.Flavor{
+ {ID: "1", Name: "m1.tiny", Disk: 1, RAM: 512, VCPUs: 1},
+ {ID: "2", Name: "m2.small", Disk: 10, RAM: 1024, VCPUs: 2},
}
if !reflect.DeepEqual(expected, actual) {
@@ -110,12 +111,12 @@
`)
})
- actual, err := Get(fake.ServiceClient(), "12345").Extract()
+ actual, err := flavors.Get(fake.ServiceClient(), "12345").Extract()
if err != nil {
t.Fatalf("Unable to get flavor: %v", err)
}
- expected := &Flavor{
+ expected := &flavors.Flavor{
ID: "1",
Name: "m1.tiny",
Disk: 1,