Jon Perritt | ed7055f | 2015-01-20 19:32:49 -0700 | [diff] [blame] | 1 | package serviceassets |
| 2 | |
| 3 | import ( |
Jon Perritt | d341609 | 2015-03-27 10:36:34 -0600 | [diff] [blame] | 4 | "net/http" |
| 5 | "testing" |
Jon Perritt | ed7055f | 2015-01-20 19:32:49 -0700 | [diff] [blame] | 6 | |
Jon Perritt | d341609 | 2015-03-27 10:36:34 -0600 | [diff] [blame] | 7 | th "github.com/rackspace/gophercloud/testhelper" |
| 8 | fake "github.com/rackspace/gophercloud/testhelper/client" |
Jon Perritt | ed7055f | 2015-01-20 19:32:49 -0700 | [diff] [blame] | 9 | ) |
| 10 | |
| 11 | // HandleDeleteCDNAssetSuccessfully creates an HTTP handler at `/services/{id}/assets` on the test handler mux |
| 12 | // that responds with a `Delete` response. |
| 13 | func HandleDeleteCDNAssetSuccessfully(t *testing.T) { |
Jon Perritt | d341609 | 2015-03-27 10:36:34 -0600 | [diff] [blame] | 14 | th.Mux.HandleFunc("/services/96737ae3-cfc1-4c72-be88-5d0e7cc9a3f0/assets", func(w http.ResponseWriter, r *http.Request) { |
| 15 | th.TestMethod(t, r, "DELETE") |
| 16 | th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) |
| 17 | w.WriteHeader(http.StatusAccepted) |
| 18 | }) |
Jon Perritt | ed7055f | 2015-01-20 19:32:49 -0700 | [diff] [blame] | 19 | } |