Setting up initial cli options and http handlers

This commit is contained in:
Frederick F. Kautz IV
2014-11-02 18:56:33 -05:00
parent d02e148236
commit fc6a2a45cb
7 changed files with 119 additions and 25 deletions
+27
View File
@@ -0,0 +1,27 @@
package minio
import (
"io/ioutil"
"log"
"net/http"
"net/http/httptest"
"testing"
)
func TestPrintsStorage(t *testing.T) {
server := httptest.NewServer(http.HandlerFunc(StorageHandler))
defer server.Close()
res, err := http.Get(server.URL)
if err != nil {
log.Fatal(err)
}
body, err := ioutil.ReadAll(res.Body)
res.Body.Close()
if err != nil {
log.Fatal(err)
}
bodyString := string(body)
if bodyString != "Storage" {
log.Fatal("Expected 'Storage', Received '" + bodyString + "'")
}
}