Putbucket before PutObject in TestPutObject

This commit is contained in:
Harshavardhana 2015-01-24 15:42:24 -08:00
parent 77210fead3
commit 704d6d8b0a
1 changed files with 9 additions and 1 deletions

View File

@ -231,7 +231,8 @@ func (s *MySuite) TestPutObject(c *C) {
date1 := time.Now()
request, err := http.NewRequest("PUT", testServer.URL+"/bucket/two", bytes.NewBufferString("hello world"))
// Put Bucket before - Put Object into a bucket
request, err := http.NewRequest("PUT", testServer.URL+"/bucket/", bytes.NewBufferString(""))
c.Assert(err, IsNil)
client := http.Client{}
@ -239,6 +240,13 @@ func (s *MySuite) TestPutObject(c *C) {
c.Assert(err, IsNil)
c.Assert(response.StatusCode, Equals, http.StatusOK)
request, err = http.NewRequest("PUT", testServer.URL+"/bucket/two", bytes.NewBufferString("hello world"))
c.Assert(err, IsNil)
response, err = client.Do(request)
c.Assert(err, IsNil)
c.Assert(response.StatusCode, Equals, http.StatusOK)
date2 := time.Now()
objects = storage.ListObjects("bucket", "", 1000)