|
|
@ -351,6 +351,7 @@ func (s *MyAPISuite) TestDeleteBucketNotEmpty(c *C) { |
|
|
|
c.Assert(response.StatusCode, Equals, http.StatusConflict) |
|
|
|
c.Assert(response.StatusCode, Equals, http.StatusConflict) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Tests delete object responses and success.
|
|
|
|
func (s *MyAPISuite) TestDeleteObject(c *C) { |
|
|
|
func (s *MyAPISuite) TestDeleteObject(c *C) { |
|
|
|
request, err := s.newRequest("PUT", testAPIFSCacheServer.URL+"/deletebucketobject", 0, nil) |
|
|
|
request, err := s.newRequest("PUT", testAPIFSCacheServer.URL+"/deletebucketobject", 0, nil) |
|
|
|
c.Assert(err, IsNil) |
|
|
|
c.Assert(err, IsNil) |
|
|
@ -374,6 +375,14 @@ func (s *MyAPISuite) TestDeleteObject(c *C) { |
|
|
|
response, err = client.Do(request) |
|
|
|
response, err = client.Do(request) |
|
|
|
c.Assert(err, IsNil) |
|
|
|
c.Assert(err, IsNil) |
|
|
|
c.Assert(response.StatusCode, Equals, http.StatusNoContent) |
|
|
|
c.Assert(response.StatusCode, Equals, http.StatusNoContent) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Delete non existant object should return http.StatusNoContent.
|
|
|
|
|
|
|
|
request, err = s.newRequest("DELETE", testAPIFSCacheServer.URL+"/deletebucketobject/myobject1", 0, nil) |
|
|
|
|
|
|
|
c.Assert(err, IsNil) |
|
|
|
|
|
|
|
client = http.Client{} |
|
|
|
|
|
|
|
response, err = client.Do(request) |
|
|
|
|
|
|
|
c.Assert(err, IsNil) |
|
|
|
|
|
|
|
c.Assert(response.StatusCode, Equals, http.StatusNoContent) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (s *MyAPISuite) TestNonExistantBucket(c *C) { |
|
|
|
func (s *MyAPISuite) TestNonExistantBucket(c *C) { |
|
|
|