// Test Image delete
func TestDeleteImage(t *testing.T) {
	th.SetupHTTP()
	defer th.TeardownHTTP()

	th.Mux.HandleFunc("/images/12345678", func(w http.ResponseWriter, r *http.Request) {
		th.TestMethod(t, r, "DELETE")
		th.TestHeader(t, r, "X-Auth-Token", fake.TokenID)

		w.WriteHeader(http.StatusNoContent)
	})

	res := images.Delete(fake.ServiceClient(), "12345678")
	th.AssertNoErr(t, res.Err)
}
Exemple #2
0
func (a *Artifact) Destroy() error {
	log.Printf("Destroying image: %s", a.ImageId)
	return images.Delete(a.Client, a.ImageId).ExtractErr()
}