mirror of
https://github.com/minio/minio.git
synced 2026-11-26 15:25:53 +00:00
Setting up initial cli options and http handlers
This commit is contained in:
1 parent
d02e148236
commit
fc6a2a45cb
7 files changed
+119
-25
No files matched your search
@@ -0,0 +1,27 @@
|
||||
package minio
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestPrintsGateway(t *testing.T) {
|
||||
server := httptest.NewServer(http.HandlerFunc(GatewayHandler))
|
||||
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 != "Gateway" {
|
||||
log.Fatal("Expected 'Gateway', Received '" + bodyString + "'")
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user