Moving gateway and storage driver to packages

This commit is contained in:
Frederick F. Kautz IV
2014-11-29 14:42:22 -08:00
parent d6b65f1f04
commit 03beef3afc
9 changed files with 27 additions and 23 deletions

View 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 + "'")
}
}