Create tests handling an omitted Content-Type header.
diff --git a/openstack/objectstorage/v1/objects/requests_test.go b/openstack/objectstorage/v1/objects/requests_test.go
index c3c28a7..6be3534 100644
--- a/openstack/objectstorage/v1/objects/requests_test.go
+++ b/openstack/objectstorage/v1/objects/requests_test.go
@@ -83,14 +83,24 @@
func TestCreateObject(t *testing.T) {
th.SetupHTTP()
defer th.TeardownHTTP()
- HandleCreateObjectSuccessfully(t)
+ HandleCreateTextObjectSuccessfully(t)
content := bytes.NewBufferString("Did gyre and gimble in the wabe")
- options := &CreateOpts{ContentType: "application/json"}
+ options := &CreateOpts{ContentType: "text/plain"}
res := Create(fake.ServiceClient(), "testContainer", "testObject", content, options)
th.AssertNoErr(t, res.Err)
}
+func TestCreateObjectWithoutContentType(t *testing.T) {
+ th.SetupHTTP()
+ defer th.TeardownHTTP()
+ HandleCreateTypelessObjectSuccessfully(t)
+
+ content := bytes.NewBufferString("The sky was the color of television, tuned to a dead channel.")
+ res := Create(fake.ServiceClient(), "testContainer", "testObject", content, &CreateOpts{})
+ th.AssertNoErr(t, res.Err)
+}
+
func TestCopyObject(t *testing.T) {
th.SetupHTTP()
defer th.TeardownHTTP()