mirror of
https://github.com/minio/minio.git
synced 2026-11-22 15:13:48 +00:00
Method not allowed is right response for DELETE() operations and add tests
This commit is contained in:
1 parent
52f21e6696
commit
e605787e65
4 files changed
+59
-2
No files matched your search
@@ -65,6 +65,25 @@ func (s *MyAPIDonutCacheSuite) TearDownSuite(c *C) {
|
||||
testAPIDonutCacheServer.Close()
|
||||
}
|
||||
|
||||
func (s *MyAPIDonutCacheSuite) TestDeleteBucket(c *C) {
|
||||
request, err := http.NewRequest("DELETE", testAPIDonutCacheServer.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 *MyAPIDonutCacheSuite) TestDeleteObject(c *C) {
|
||||
request, err := http.NewRequest("DELETE", testAPIDonutCacheServer.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 *MyAPIDonutCacheSuite) TestNonExistantBucket(c *C) {
|
||||
request, err := http.NewRequest("HEAD", testAPIDonutCacheServer.URL+"/nonexistantbucket", nil)
|
||||
c.Assert(err, IsNil)
|
||||
|
||||
Reference in new issue
Block a user