| Index: server/prpc/error_test.go
|
| diff --git a/server/prpc/error_test.go b/server/prpc/error_test.go
|
| index 43957cc67744155de3ffb15d592650f901255c1b..7b378b9e36eecb56d426122c548f949f5fcec458 100644
|
| --- a/server/prpc/error_test.go
|
| +++ b/server/prpc/error_test.go
|
| @@ -5,49 +5,15 @@
|
| package prpc
|
|
|
| import (
|
| - "fmt"
|
| "net/http"
|
| "testing"
|
|
|
| - "google.golang.org/grpc"
|
| - "google.golang.org/grpc/codes"
|
| -
|
| . "github.com/smartystreets/goconvey/convey"
|
| )
|
|
|
| func TestError(t *testing.T) {
|
| t.Parallel()
|
|
|
| - Convey("ErrorCode", t, func() {
|
| - status := ErrorStatus(nil)
|
| - So(status, ShouldEqual, http.StatusOK)
|
| -
|
| - status = ErrorStatus(grpc.Errorf(codes.NotFound, "Not found"))
|
| - So(status, ShouldEqual, http.StatusNotFound)
|
| -
|
| - status = ErrorStatus(withStatus(fmt.Errorf(""), http.StatusBadRequest))
|
| - So(status, ShouldEqual, http.StatusBadRequest)
|
| -
|
| - status = ErrorStatus(fmt.Errorf("unhandled"))
|
| - So(status, ShouldEqual, http.StatusInternalServerError)
|
| - })
|
| -
|
| - Convey("ErrorDesc", t, func() {
|
| - So(ErrorDesc(nil), ShouldEqual, "")
|
| -
|
| - err := Errorf(http.StatusNotFound, "not found")
|
| - So(ErrorDesc(err), ShouldEqual, "not found")
|
| -
|
| - err = grpc.Errorf(codes.NotFound, "not found")
|
| - So(ErrorDesc(err), ShouldEqual, "not found")
|
| -
|
| - err = withStatus(grpc.Errorf(codes.NotFound, "not found"), http.StatusNotFound)
|
| - So(ErrorDesc(err), ShouldEqual, "not found")
|
| -
|
| - err = fmt.Errorf("not found")
|
| - So(ErrorDesc(err), ShouldEqual, "not found")
|
| - })
|
| -
|
| Convey("withStatus", t, func() {
|
| Convey("withStatus(nil, *) returns nil", func() {
|
| So(withStatus(nil, http.StatusBadRequest), ShouldBeNil)
|
|
|