Feature/filestorage availabilityzones list (#153)
* sfs: Add support for Availability Zone List
* sfs: Add acceptance tests for Availability zones List
* sfs: Fix review comments
diff --git a/openstack/sharedfilesystems/v2/availabilityzones/testing/fixtures.go b/openstack/sharedfilesystems/v2/availabilityzones/testing/fixtures.go
new file mode 100644
index 0000000..e5db8cd
--- /dev/null
+++ b/openstack/sharedfilesystems/v2/availabilityzones/testing/fixtures.go
@@ -0,0 +1,32 @@
+package testing
+
+import (
+ "fmt"
+ "net/http"
+ "testing"
+
+ th "github.com/gophercloud/gophercloud/testhelper"
+ fake "github.com/gophercloud/gophercloud/testhelper/client"
+)
+
+func MockListResponse(t *testing.T) {
+ th.Mux.HandleFunc("/os-availability-zone", func(w http.ResponseWriter, r *http.Request) {
+ th.TestMethod(t, r, "GET")
+ th.TestHeader(t, r, "X-Auth-Token", fake.TokenID)
+
+ w.Header().Add("Content-Type", "application/json")
+ w.WriteHeader(http.StatusOK)
+
+ fmt.Fprintf(w, `
+ {
+ "availability_zones": [
+ {
+ "name": "nova",
+ "created_at": "2015-09-18T09:50:55.000000",
+ "updated_at": null,
+ "id": "388c983d-258e-4a0e-b1ba-10da37d766db"
+ }
+ ]
+ }`)
+ })
+}