OSDN Git Service

Modify io_test to not support bytom/log && Add logrus in glid.lock
[bytom/bytom.git] / net / http / httpjson / io_test.go
index 3219893..19ac638 100644 (file)
@@ -1,15 +1,10 @@
 package httpjson
 
 import (
-       "bytes"
        "context"
-       "errors"
        "net/http/httptest"
-       "os"
        "strings"
        "testing"
-
-       "github.com/bytom/log"
 )
 
 func TestWriteArray(t *testing.T) {
@@ -32,22 +27,6 @@ func TestWriteArray(t *testing.T) {
        }
 }
 
-func TestWriteErr(t *testing.T) {
-       var buf bytes.Buffer
-       log.SetOutput(&buf)
-       defer log.SetOutput(os.Stderr)
-
-       want := "test-error"
-
-       ctx := context.Background()
-       resp := &errResponse{httptest.NewRecorder(), errors.New(want)}
-       Write(ctx, resp, 200, "ok")
-       got := buf.String()
-       if !strings.Contains(got, want) {
-               t.Errorf("log = %v; should contain %q", got, want)
-       }
-}
-
 type errResponse struct {
        *httptest.ResponseRecorder
        err error