From 9221aa6de1249f77794953373c2cf66e82c33b1e Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Sun, 3 Apr 2016 01:11:09 +0800 Subject: [PATCH] update testing. Signed-off-by: Bo-Yi Wu --- gorush/server_test.go | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/gorush/server_test.go b/gorush/server_test.go index 6518389..5dbdfd7 100644 --- a/gorush/server_test.go +++ b/gorush/server_test.go @@ -5,7 +5,6 @@ import ( "github.com/buger/jsonparser" "github.com/gin-gonic/gin" "github.com/stretchr/testify/assert" - "io/ioutil" "net/http" "os" "runtime" @@ -20,16 +19,6 @@ func initTest() { PushConf.Core.Mode = "test" } -func testRequest(t *testing.T, url string) { - resp, err := http.Get(url) - defer resp.Body.Close() - assert.NoError(t, err) - - _, ioerr := ioutil.ReadAll(resp.Body) - assert.NoError(t, ioerr) - assert.Equal(t, "200 OK", resp.Status, "should get a 200") -} - func TestPrintGoPushVersion(t *testing.T) { PrintGoPushVersion() } @@ -47,7 +36,7 @@ func TestRunNormalServer(t *testing.T) { time.Sleep(5 * time.Millisecond) assert.Error(t, router.Run(":8088")) - testRequest(t, "http://localhost:8088/api/status") + gofight.TestRequest(t, "http://localhost:8088/api/status") } // func TestRunTLSServer(t *testing.T) {