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

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 a93631f5a5e730b41f2fa9a2e3d5201b32bbfaaf..21b0d0f5da6aac7925b6327e5eecfd1125619abd 100644
--- a/appengine/cmd/milo/buildbot/pubsub_test.go
+++ b/appengine/cmd/milo/buildbot/pubsub_test.go
@@ -20,6 +20,7 @@ import (
"github.com/luci/gae/impl/memory"
"github.com/luci/gae/service/datastore"
"github.com/luci/luci-go/common/clock/testclock"
+ "github.com/luci/luci-go/server/router"
//log "github.com/luci/luci-go/common/logging"
"github.com/luci/luci-go/common/logging/gologger"
. "github.com/luci/luci-go/common/testing/assertions"
@@ -181,7 +182,12 @@ 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{
@@ -213,7 +219,12 @@ 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,
+ })
So(h.Code, ShouldEqual, 200)
m, internal, t, err := getMasterJSON(c, "fakename")
So(err, ShouldBeNil)
@@ -229,7 +240,12 @@ 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",
@@ -247,7 +263,12 @@ 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",
@@ -266,7 +287,12 @@ 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