Putbucket before PutObject in TestPutObject

master
Harshavardhana 10 years ago
parent 77210fead3
commit 704d6d8b0a
  1. 10
      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)

Loading…
Cancel
Save