mirror of
https://github.com/minio/mc.git
synced 2025-11-14 23:42:27 +03:00
Finish object handlers for mc commands, updated relevant tests respectively
This commit is contained in:
18
cmd_test.go
18
cmd_test.go
@@ -28,7 +28,6 @@ import (
|
||||
|
||||
"errors"
|
||||
"net"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
|
||||
. "github.com/minio/check"
|
||||
@@ -49,20 +48,6 @@ func mustGetMcConfigDir() string {
|
||||
|
||||
var server *httptest.Server
|
||||
|
||||
type objectAPIHandler struct {
|
||||
bucket string
|
||||
object []string
|
||||
data []byte
|
||||
}
|
||||
|
||||
func (h objectAPIHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
switch {
|
||||
case r.Method == "GET":
|
||||
case r.Method == "PUT":
|
||||
case r.Method == "POST":
|
||||
}
|
||||
}
|
||||
|
||||
func (s *CmdTestSuite) SetUpSuite(c *C) {
|
||||
configDir, err := ioutil.TempDir(os.TempDir(), "cmd-")
|
||||
c.Assert(err, IsNil)
|
||||
@@ -71,14 +56,13 @@ func (s *CmdTestSuite) SetUpSuite(c *C) {
|
||||
_, err = doConfig("generate", nil)
|
||||
c.Assert(err, IsNil)
|
||||
|
||||
objectAPI := objectAPIHandler(objectAPIHandler{})
|
||||
objectAPI := objectAPIHandler(objectAPIHandler{bucket: "bucket", object: make(map[string][]byte)})
|
||||
server = httptest.NewServer(objectAPI)
|
||||
}
|
||||
|
||||
func (s *CmdTestSuite) TearDownSuite(c *C) {
|
||||
os.RemoveAll(customConfigDir)
|
||||
server.Close()
|
||||
|
||||
}
|
||||
|
||||
func (s *CmdTestSuite) TestGetNewClient(c *C) {
|
||||
|
||||
Reference in New Issue
Block a user