blob: c4739ae8e8095b753aec1148532fedf95ec16e7e [file] [log] [blame]
Keith Byrnebda48592016-03-23 11:37:08 +00001// +build fixtures
2
Jon Perritted7055f2015-01-20 19:32:49 -07003package serviceassets
4
5import (
Jon Perrittd3416092015-03-27 10:36:34 -06006 "net/http"
7 "testing"
Jon Perritted7055f2015-01-20 19:32:49 -07008
Jon Perrittd3416092015-03-27 10:36:34 -06009 th "github.com/rackspace/gophercloud/testhelper"
10 fake "github.com/rackspace/gophercloud/testhelper/client"
Jon Perritted7055f2015-01-20 19:32:49 -070011)
12
13// HandleDeleteCDNAssetSuccessfully creates an HTTP handler at `/services/{id}/assets` on the test handler mux
14// that responds with a `Delete` response.
15func HandleDeleteCDNAssetSuccessfully(t *testing.T) {
Jon Perrittd3416092015-03-27 10:36:34 -060016 th.Mux.HandleFunc("/services/96737ae3-cfc1-4c72-be88-5d0e7cc9a3f0/assets", func(w http.ResponseWriter, r *http.Request) {
17 th.TestMethod(t, r, "DELETE")
18 th.TestHeader(t, r, "X-Auth-Token", fake.TokenID)
19 w.WriteHeader(http.StatusAccepted)
20 })
Jon Perritted7055f2015-01-20 19:32:49 -070021}