Identity v3 Projects Delete (#166)
diff --git a/openstack/identity/v3/projects/testing/fixtures.go b/openstack/identity/v3/projects/testing/fixtures.go
index 0c839b8..96a4e41 100644
--- a/openstack/identity/v3/projects/testing/fixtures.go
+++ b/openstack/identity/v3/projects/testing/fixtures.go
@@ -130,3 +130,14 @@
fmt.Fprintf(w, GetOutput)
})
}
+
+// HandleDeleteProjectSuccessfully creates an HTTP handler at `/projects` on the
+// test handler mux that tests project deletion.
+func HandleDeleteProjectSuccessfully(t *testing.T) {
+ th.Mux.HandleFunc("/projects/1234", func(w http.ResponseWriter, r *http.Request) {
+ th.TestMethod(t, r, "DELETE")
+ th.TestHeader(t, r, "X-Auth-Token", client.TokenID)
+
+ w.WriteHeader(http.StatusNoContent)
+ })
+}
diff --git a/openstack/identity/v3/projects/testing/requests_test.go b/openstack/identity/v3/projects/testing/requests_test.go
index daed4eb..2b2e27c 100644
--- a/openstack/identity/v3/projects/testing/requests_test.go
+++ b/openstack/identity/v3/projects/testing/requests_test.go
@@ -53,3 +53,12 @@
th.AssertNoErr(t, err)
th.CheckDeepEquals(t, RedTeam, *actual)
}
+
+func TestDeleteProject(t *testing.T) {
+ th.SetupHTTP()
+ defer th.TeardownHTTP()
+ HandleDeleteProjectSuccessfully(t)
+
+ res := projects.Delete(client.ServiceClient(), "1234")
+ th.AssertNoErr(t, res.Err)
+}