Feature/filestorage securityservices delete (#133)
* sfs: Add support for security services Delete
* sfs: Add acceptance tests for security service Delete
diff --git a/openstack/sharedfilesystems/v2/securityservices/testing/fixtures.go b/openstack/sharedfilesystems/v2/securityservices/testing/fixtures.go
index 78adc48..e6b101a 100644
--- a/openstack/sharedfilesystems/v2/securityservices/testing/fixtures.go
+++ b/openstack/sharedfilesystems/v2/securityservices/testing/fixtures.go
@@ -50,3 +50,11 @@
}`)
})
}
+
+func MockDeleteResponse(t *testing.T) {
+ th.Mux.HandleFunc("/security-services/securityServiceID", func(w http.ResponseWriter, r *http.Request) {
+ th.TestMethod(t, r, "DELETE")
+ th.TestHeader(t, r, "X-Auth-Token", fake.TokenID)
+ w.WriteHeader(http.StatusAccepted)
+ })
+}
diff --git a/openstack/sharedfilesystems/v2/securityservices/testing/requests_test.go b/openstack/sharedfilesystems/v2/securityservices/testing/requests_test.go
index 2b3325e..8ef88ee 100644
--- a/openstack/sharedfilesystems/v2/securityservices/testing/requests_test.go
+++ b/openstack/sharedfilesystems/v2/securityservices/testing/requests_test.go
@@ -51,3 +51,14 @@
t.Fatal("ErrMissingInput was expected to occur")
}
}
+
+// Verifies that security service deletion works
+func TestDelete(t *testing.T) {
+ th.SetupHTTP()
+ defer th.TeardownHTTP()
+
+ MockDeleteResponse(t)
+
+ res := securityservices.Delete(client.ServiceClient(), "securityServiceID")
+ th.AssertNoErr(t, res.Err)
+}