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/keypairs_test.go b/acceptance/openstack/compute/v2/keypairs_test.go
index 3c6abb4..c4b91ec 100644
--- a/acceptance/openstack/compute/v2/keypairs_test.go
+++ b/acceptance/openstack/compute/v2/keypairs_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/keypairs"
"github.com/gophercloud/gophercloud/openstack/compute/v2/servers"
)
@@ -29,7 +30,7 @@
}
for _, keypair := range allKeys {
- PrintKeyPair(t, &keypair)
+ tools.PrintResource(t, keypair)
}
}
@@ -45,7 +46,7 @@
}
defer DeleteKeyPair(t, client, keyPair)
- PrintKeyPair(t, keyPair)
+ tools.PrintResource(t, keyPair)
}
func TestKeypairsImportPublicKey(t *testing.T) {
@@ -65,7 +66,7 @@
}
defer DeleteKeyPair(t, client, keyPair)
- PrintKeyPair(t, keyPair)
+ tools.PrintResource(t, keyPair)
}
func TestKeypairsServerCreateWithKey(t *testing.T) {
@@ -78,11 +79,6 @@
t.Fatalf("Unable to create a compute client: %v", err)
}
- choices, err := clients.AcceptanceTestChoicesFromEnv()
- if err != nil {
- t.Fatal(err)
- }
-
publicKey, err := createKey()
if err != nil {
t.Fatalf("Unable to create public key: %s", err)
@@ -94,7 +90,7 @@
}
defer DeleteKeyPair(t, client, keyPair)
- server, err := CreateServerWithPublicKey(t, client, choices, keyPair.Name)
+ server, err := CreateServerWithPublicKey(t, client, keyPair.Name)
if err != nil {
t.Fatalf("Unable to create server: %s", err)
}