Acceptance Test Updates (#218)
* compute: don't pass choices
* blockstorage: don't pass choices
* DumpResource Function
This function prints a resource in JSON format but retains the actual
field name rather than using the name specified in the JSON tag.
* New DumpResource
This version just converts the resource into JSON. The original is
being left in git history for posterity.
* Renaming DumpResource to PrintResource
* Removing all print functions in favor of PrintResource
* Rebase reconcilliation
diff --git a/acceptance/openstack/compute/v2/servergroup_test.go b/acceptance/openstack/compute/v2/servergroup_test.go
index 5921014..ac1915f 100644
--- a/acceptance/openstack/compute/v2/servergroup_test.go
+++ b/acceptance/openstack/compute/v2/servergroup_test.go
@@ -6,6 +6,7 @@
"testing"
"github.com/gophercloud/gophercloud/acceptance/clients"
+ "github.com/gophercloud/gophercloud/acceptance/tools"
"github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/servergroups"
"github.com/gophercloud/gophercloud/openstack/compute/v2/servers"
)
@@ -27,7 +28,7 @@
}
for _, serverGroup := range allServerGroups {
- PrintServerGroup(t, &serverGroup)
+ tools.PrintResource(t, serverGroup)
}
}
@@ -48,7 +49,7 @@
t.Fatalf("Unable to get server group: %v", err)
}
- PrintServerGroup(t, serverGroup)
+ tools.PrintResource(t, serverGroup)
}
func TestServergroupsAffinityPolicy(t *testing.T) {
@@ -57,18 +58,13 @@
t.Fatalf("Unable to create a compute client: %v", err)
}
- choices, err := clients.AcceptanceTestChoicesFromEnv()
- if err != nil {
- t.Fatal(err)
- }
-
serverGroup, err := CreateServerGroup(t, client, "affinity")
if err != nil {
t.Fatalf("Unable to create server group: %v", err)
}
defer DeleteServerGroup(t, client, serverGroup)
- firstServer, err := CreateServerInServerGroup(t, client, choices, serverGroup)
+ firstServer, err := CreateServerInServerGroup(t, client, serverGroup)
if err != nil {
t.Fatalf("Unable to create server: %v", err)
}
@@ -76,7 +72,7 @@
firstServer, err = servers.Get(client, firstServer.ID).Extract()
- secondServer, err := CreateServerInServerGroup(t, client, choices, serverGroup)
+ secondServer, err := CreateServerInServerGroup(t, client, serverGroup)
if err != nil {
t.Fatalf("Unable to create server: %v", err)
}