Use a ReadSeeker for upload content and rewind the offset on retries
diff --git a/rackspace/objectstorage/v1/objects/delegate_test.go b/rackspace/objectstorage/v1/objects/delegate_test.go
index 8ab8029..3431056 100644
--- a/rackspace/objectstorage/v1/objects/delegate_test.go
+++ b/rackspace/objectstorage/v1/objects/delegate_test.go
@@ -1,7 +1,7 @@
package objects
import (
- "bytes"
+ "strings"
"testing"
os "github.com/rackspace/gophercloud/openstack/objectstorage/v1/objects"
@@ -68,7 +68,7 @@
defer th.TeardownHTTP()
os.HandleCreateTextObjectSuccessfully(t)
- content := bytes.NewBufferString("Did gyre and gimble in the wabe")
+ content := strings.NewReader("Did gyre and gimble in the wabe")
options := &os.CreateOpts{ContentType: "text/plain"}
res := Create(fake.ServiceClient(), "testContainer", "testObject", content, options)
th.AssertNoErr(t, res.Err)
@@ -79,7 +79,7 @@
defer th.TeardownHTTP()
os.HandleCreateTypelessObjectSuccessfully(t)
- content := bytes.NewBufferString("The sky was the color of television, tuned to a dead channel.")
+ content := strings.NewReader("The sky was the color of television, tuned to a dead channel.")
res := Create(fake.ServiceClient(), "testContainer", "testObject", content, &os.CreateOpts{})
th.AssertNoErr(t, res.Err)
}