mirror of
https://github.com/minio/minio.git
synced 2025-12-07 16:22:33 -05:00
Moving gateway and storage driver to packages
This commit is contained in:
27
pkgs/storage/storage_test.go
Normal file
27
pkgs/storage/storage_test.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package storage
|
||||
|
||||
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 + "'")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user