1
0
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:
Harshavardhana
2015-05-21 16:46:17 -07:00
parent c086903519
commit a0177fc1fe
9 changed files with 275 additions and 46 deletions

View File

@@ -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) {