diff --git a/pkg/webapi/minioapi/minioapi_test.go b/pkg/webapi/minioapi/minioapi_test.go index d4377b195..2a8b5961d 100644 --- a/pkg/webapi/minioapi/minioapi_test.go +++ b/pkg/webapi/minioapi/minioapi_test.go @@ -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)