You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
509 B
27 lines
509 B
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 + "'")
|
|
}
|
|
}
|
|
|