add test for CreateHeader Extract method
diff --git a/openstack/objectstorage/v1/containers/fixtures.go b/openstack/objectstorage/v1/containers/fixtures.go
index 1c0a915..9c84bce 100644
--- a/openstack/objectstorage/v1/containers/fixtures.go
+++ b/openstack/objectstorage/v1/containers/fixtures.go
@@ -94,6 +94,7 @@
th.TestHeader(t, r, "Accept", "application/json")
w.Header().Add("X-Container-Meta-Foo", "bar")
+ w.Header().Add("X-Trans-Id", "1234567")
w.WriteHeader(http.StatusNoContent)
})
}
diff --git a/openstack/objectstorage/v1/containers/requests_test.go b/openstack/objectstorage/v1/containers/requests_test.go
index d0ce7f1..f650696 100644
--- a/openstack/objectstorage/v1/containers/requests_test.go
+++ b/openstack/objectstorage/v1/containers/requests_test.go
@@ -58,8 +58,10 @@
options := CreateOpts{ContentType: "application/json", Metadata: map[string]string{"foo": "bar"}}
res := Create(fake.ServiceClient(), "testContainer", options)
- th.CheckNoErr(t, res.Err)
+ c, err := res.Extract()
+ th.CheckNoErr(t, err)
th.CheckEquals(t, "bar", res.Header["X-Container-Meta-Foo"][0])
+ th.CheckEquals(t, "1234567", c.TransID)
}
func TestDeleteContainer(t *testing.T) {