Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(70)

Unified Diff: server/prpc/decoding_test.go

Issue 1605363002: common/prpc, tools/cmd/cproto: prpc client (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-go@master
Patch Set: rebased and addressed comments Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « server/prpc/decoding.go ('k') | server/prpc/encoding.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: server/prpc/decoding_test.go
diff --git a/server/prpc/decoding_test.go b/server/prpc/decoding_test.go
index 05807a92c2bad1573ea779cd1ae6f15a3416c755..c50d1d0754f610c749633ca56b62943a1f897ef5 100644
--- a/server/prpc/decoding_test.go
+++ b/server/prpc/decoding_test.go
@@ -56,7 +56,7 @@ func TestDecoding(t *testing.T) {
Convey("readMessage", t, func() {
var msg HelloRequest
- read := func(contentType string, body []byte) error {
+ read := func(contentType string, body []byte) *protocolError {
req := &http.Request{
Body: ioutil.NopCloser(bytes.NewBuffer(body)),
Header: http.Header{},
@@ -85,7 +85,7 @@ func TestDecoding(t *testing.T) {
Convey("malformed body", func() {
err := read(mtPRPCBinary, []byte{0})
So(err, ShouldNotBeNil)
- So(ErrorStatus(err), ShouldEqual, http.StatusBadRequest)
+ So(err.status, ShouldEqual, http.StatusBadRequest)
})
Convey("empty body", func() {
err := read(mtPRPCBinary, nil)
@@ -104,7 +104,7 @@ func TestDecoding(t *testing.T) {
Convey("malformed body", func() {
err := read(mtPRPCJSNOPB, []byte{0})
So(err, ShouldNotBeNil)
- So(ErrorStatus(err), ShouldEqual, http.StatusBadRequest)
+ So(err.status, ShouldEqual, http.StatusBadRequest)
})
Convey("empty body", func() {
err := read(mtPRPCJSNOPB, nil)
@@ -120,7 +120,7 @@ func TestDecoding(t *testing.T) {
Convey("malformed body", func() {
err := read(mtPRPCText, []byte{0})
So(err, ShouldNotBeNil)
- So(ErrorStatus(err), ShouldEqual, http.StatusBadRequest)
+ So(err.status, ShouldEqual, http.StatusBadRequest)
})
Convey("empty body", func() {
err := read(mtPRPCText, nil)
@@ -131,7 +131,7 @@ func TestDecoding(t *testing.T) {
Convey("unsupported media type", func() {
err := read("blah", nil)
So(err, ShouldNotBeNil)
- So(ErrorStatus(err), ShouldEqual, http.StatusUnsupportedMediaType)
+ So(err.status, ShouldEqual, http.StatusUnsupportedMediaType)
})
})
« no previous file with comments | « server/prpc/decoding.go ('k') | server/prpc/encoding.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698