OSDN Git Service

Modify io_test to not support bytom/log && Add logrus in glid.lock
authorgguoss <1536310027@qq.com>
Wed, 18 Oct 2017 07:01:55 +0000 (15:01 +0800)
committergguoss <1536310027@qq.com>
Wed, 18 Oct 2017 07:01:55 +0000 (15:01 +0800)
glide.lock
net/http/httpjson/io_test.go

index c311e72..6e1a3a4 100644 (file)
@@ -151,6 +151,7 @@ imports:
 - name: github.com/kr/secureheader
 - name: github.com/pborman/uuid
 - name: github.com/rjeczalik/notify
+- name: github.com/sirupsen/logrus
 - name: golang.org/x/sys
   version: e62c3de784db939836898e5c19ffd41bece347da
   subpackages:
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