mirror of
https://github.com/minio/minio.git
synced 2025-11-21 10:16:03 -05:00
Method not allowed is right response for DELETE() operations and add tests
This commit is contained in:
@@ -84,6 +84,25 @@ func (s *MyAPIDonutSuite) TearDownSuite(c *C) {
|
||||
testAPIDonutServer.Close()
|
||||
}
|
||||
|
||||
func (s *MyAPIDonutSuite) TestDeleteBucket(c *C) {
|
||||
request, err := http.NewRequest("DELETE", testAPIDonutServer.URL+"/mybucket", nil)
|
||||
c.Assert(err, IsNil)
|
||||
|
||||
client := &http.Client{}
|
||||
response, err := client.Do(request)
|
||||
c.Assert(err, IsNil)
|
||||
c.Assert(response.StatusCode, Equals, http.StatusMethodNotAllowed)
|
||||
}
|
||||
|
||||
func (s *MyAPIDonutSuite) TestDeleteObject(c *C) {
|
||||
request, err := http.NewRequest("DELETE", testAPIDonutServer.URL+"/mybucket/myobject", nil)
|
||||
c.Assert(err, IsNil)
|
||||
client := &http.Client{}
|
||||
response, err := client.Do(request)
|
||||
c.Assert(err, IsNil)
|
||||
c.Assert(response.StatusCode, Equals, http.StatusMethodNotAllowed)
|
||||
}
|
||||
|
||||
func (s *MyAPIDonutSuite) TestNonExistantBucket(c *C) {
|
||||
request, err := http.NewRequest("HEAD", testAPIDonutServer.URL+"/nonexistantbucket", nil)
|
||||
c.Assert(err, IsNil)
|
||||
|
||||
Reference in New Issue
Block a user