unit test for unsuccessful update operation
diff --git a/openstack/cdn/v1/services/requests_test.go b/openstack/cdn/v1/services/requests_test.go
index d06afcb..ca7c269 100644
--- a/openstack/cdn/v1/services/requests_test.go
+++ b/openstack/cdn/v1/services/requests_test.go
@@ -292,7 +292,7 @@
th.AssertDeepEquals(t, expected, actual)
}
-func TestUpdate(t *testing.T) {
+func TestSuccessfulUpdate(t *testing.T) {
th.SetupHTTP()
defer th.TeardownHTTP()
@@ -322,6 +322,36 @@
th.AssertEquals(t, expected, actual)
}
+func TestUnsuccessfulUpdate(t *testing.T) {
+ th.SetupHTTP()
+ defer th.TeardownHTTP()
+
+ HandleUpdateCDNServiceSuccessfully(t)
+
+ updateOpts := UpdateOpts{
+ UpdateOpt{
+ Op: "Foo",
+ Path: "/origins/0",
+ Value: map[string]interface{}{
+ "origin": "44.33.22.11",
+ "port": 80,
+ "ssl": false,
+ },
+ },
+ UpdateOpt{
+ Op: Add,
+ Path: "/domains/0",
+ Value: map[string]interface{}{
+ "domain": "added.mocksite4.com",
+ },
+ },
+ }
+ _, err := Update(fake.ServiceClient(), "96737ae3-cfc1-4c72-be88-5d0e7cc9a3f0", updateOpts).Extract()
+ if err == nil {
+ t.Errorf("Expected error during TestUnsuccessfulUpdate but didn't get one.")
+ }
+}
+
func TestDelete(t *testing.T) {
th.SetupHTTP()
defer th.TeardownHTTP()