move unit tests into 'testing' directories
diff --git a/openstack/orchestration/v1/stacktemplates/testing/doc.go b/openstack/orchestration/v1/stacktemplates/testing/doc.go
new file mode 100644
index 0000000..7603f83
--- /dev/null
+++ b/openstack/orchestration/v1/stacktemplates/testing/doc.go
@@ -0,0 +1 @@
+package testing
diff --git a/openstack/orchestration/v1/stacktemplates/fixtures.go b/openstack/orchestration/v1/stacktemplates/testing/fixtures.go
similarity index 95%
rename from openstack/orchestration/v1/stacktemplates/fixtures.go
rename to openstack/orchestration/v1/stacktemplates/testing/fixtures.go
index 4444a57..23ec579 100644
--- a/openstack/orchestration/v1/stacktemplates/fixtures.go
+++ b/openstack/orchestration/v1/stacktemplates/testing/fixtures.go
@@ -1,12 +1,11 @@
-// +build fixtures
-
-package stacktemplates
+package testing
import (
"fmt"
"net/http"
"testing"
+ "github.com/gophercloud/gophercloud/openstack/orchestration/v1/stacktemplates"
th "github.com/gophercloud/gophercloud/testhelper"
fake "github.com/gophercloud/gophercloud/testhelper/client"
)
@@ -54,7 +53,7 @@
}
// ValidateExpected represents the expected object from a Validate request.
-var ValidateExpected = &ValidatedTemplate{
+var ValidateExpected = &stacktemplates.ValidatedTemplate{
Description: "Simple template to test heat commands",
Parameters: map[string]interface{}{
"flavor": map[string]interface{}{
diff --git a/openstack/orchestration/v1/stacktemplates/requests_test.go b/openstack/orchestration/v1/stacktemplates/testing/requests_test.go
similarity index 78%
rename from openstack/orchestration/v1/stacktemplates/requests_test.go
rename to openstack/orchestration/v1/stacktemplates/testing/requests_test.go
index 42663dc..442bcb7 100644
--- a/openstack/orchestration/v1/stacktemplates/requests_test.go
+++ b/openstack/orchestration/v1/stacktemplates/testing/requests_test.go
@@ -1,8 +1,9 @@
-package stacktemplates
+package testing
import (
"testing"
+ "github.com/gophercloud/gophercloud/openstack/orchestration/v1/stacktemplates"
th "github.com/gophercloud/gophercloud/testhelper"
fake "github.com/gophercloud/gophercloud/testhelper/client"
)
@@ -12,7 +13,7 @@
defer th.TeardownHTTP()
HandleGetSuccessfully(t, GetOutput)
- actual, err := Get(fake.ServiceClient(), "postman_stack", "16ef0584-4458-41eb-87c8-0dc8d5f66c87").Extract()
+ actual, err := stacktemplates.Get(fake.ServiceClient(), "postman_stack", "16ef0584-4458-41eb-87c8-0dc8d5f66c87").Extract()
th.AssertNoErr(t, err)
expected := GetExpected
@@ -24,7 +25,7 @@
defer th.TeardownHTTP()
HandleValidateSuccessfully(t, ValidateOutput)
- opts := ValidateOpts{
+ opts := stacktemplates.ValidateOpts{
Template: `{
"heat_template_version": "2013-05-23",
"description": "Simple template to test heat commands",
@@ -49,7 +50,7 @@
}
}`,
}
- actual, err := Validate(fake.ServiceClient(), opts).Extract()
+ actual, err := stacktemplates.Validate(fake.ServiceClient(), opts).Extract()
th.AssertNoErr(t, err)
expected := ValidateExpected