blob: e5db8cda6620c48c2cbecbdf6a8c2b7c87f291f9 [file] [log] [blame]
ehdouc2b8dcd2017-01-11 06:01:00 +02001package testing
2
3import (
4 "fmt"
5 "net/http"
6 "testing"
7
8 th "github.com/gophercloud/gophercloud/testhelper"
9 fake "github.com/gophercloud/gophercloud/testhelper/client"
10)
11
12func MockListResponse(t *testing.T) {
13 th.Mux.HandleFunc("/os-availability-zone", func(w http.ResponseWriter, r *http.Request) {
14 th.TestMethod(t, r, "GET")
15 th.TestHeader(t, r, "X-Auth-Token", fake.TokenID)
16
17 w.Header().Add("Content-Type", "application/json")
18 w.WriteHeader(http.StatusOK)
19
20 fmt.Fprintf(w, `
21 {
22 "availability_zones": [
23 {
24 "name": "nova",
25 "created_at": "2015-09-18T09:50:55.000000",
26 "updated_at": null,
27 "id": "388c983d-258e-4a0e-b1ba-10da37d766db"
28 }
29 ]
30 }`)
31 })
32}