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

Unified Diff: appengine/cmd/milo/buildbot/pubsub_test.go

Issue 2043423004: Make HTTP middleware easier to use (Closed) Base URL: https://github.com/luci/luci-go@master
Patch Set: Update tests Created 4 years, 6 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
Index: appengine/cmd/milo/buildbot/pubsub_test.go
diff --git a/appengine/cmd/milo/buildbot/pubsub_test.go b/appengine/cmd/milo/buildbot/pubsub_test.go
index 3237b30e828f2d8256cb83e0b28194290ad4a06e..1f62c7ddacfcbcafb2fe1f40ae85318c045f89fd 100644
--- a/appengine/cmd/milo/buildbot/pubsub_test.go
+++ b/appengine/cmd/milo/buildbot/pubsub_test.go
@@ -21,6 +21,7 @@ import (
"github.com/luci/luci-go/common/clock/testclock"
"github.com/luci/luci-go/common/logging/gologger"
. "github.com/luci/luci-go/common/testing/assertions"
+ "github.com/luci/luci-go/server/router"
. "github.com/smartystreets/goconvey/convey"
"golang.org/x/net/context"
)
@@ -134,7 +135,7 @@ func TestPubSub(t *testing.T) {
Body: newCombinedPsBody([]buildbotBuild{b}, &ms),
}
p := httprouter.Params{}
- PubSubHandler(c, h, r, p)
+ PubSubHandler(&router.Context{Context: c, Writer: h, Request: r, Params: p})
So(h.Code, ShouldEqual, 200)
Convey("And stores correctly", func() {
loadB := &buildbotBuild{
@@ -166,7 +167,7 @@ func TestPubSub(t *testing.T) {
r := &http.Request{
Body: newCombinedPsBody([]buildbotBuild{b}, &ms)}
p = httprouter.Params{}
- PubSubHandler(c, h, r, p)
+ PubSubHandler(&router.Context{Context: c, Writer: h, Request: r, Params: p})
iannucci 2016/06/13 19:23:29 (I know you didn't write this :)), but it probably
nishanths 2016/06/15 18:25:08 Will do!
So(h.Code, ShouldEqual, 200)
m, internal, t, err := getDSMasterJSON(c, "fakename")
So(err, ShouldBeNil)
@@ -182,7 +183,7 @@ func TestPubSub(t *testing.T) {
Body: newCombinedPsBody([]buildbotBuild{b}, &ms),
}
p = httprouter.Params{}
- PubSubHandler(c, h, r, p)
+ PubSubHandler(&router.Context{Context: c, Writer: h, Request: r, Params: p})
So(h.Code, ShouldEqual, 200)
loadB := &buildbotBuild{
Master: "Fake Master",
@@ -200,7 +201,7 @@ func TestPubSub(t *testing.T) {
Body: newCombinedPsBody([]buildbotBuild{b}, &ms),
}
p = httprouter.Params{}
- PubSubHandler(c, h, r, p)
+ PubSubHandler(&router.Context{Context: c, Writer: h, Request: r, Params: p})
So(h.Code, ShouldEqual, 200)
loadB := &buildbotBuild{
Master: "Fake Master",
@@ -219,7 +220,7 @@ func TestPubSub(t *testing.T) {
h := httptest.NewRecorder()
r := &http.Request{Body: ioutil.NopCloser(bytes.NewReader([]byte{}))}
p := httprouter.Params{}
- PubSubHandler(c, h, r, p)
+ PubSubHandler(&router.Context{Context: c, Writer: h, Request: r, Params: p})
So(h.Code, ShouldEqual, 200)
})
})

Powered by Google App Engine
This is Rietveld 408576698