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

Unified Diff: appengine/tsmon/handler_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/tsmon/handler_test.go
diff --git a/appengine/tsmon/handler_test.go b/appengine/tsmon/handler_test.go
index 37b5b03b24f165cd67179b938ec24d977a6aa85b..09496f5f82d9e00f850438829333c018f7a5c040 100644
--- a/appengine/tsmon/handler_test.go
+++ b/appengine/tsmon/handler_test.go
@@ -18,6 +18,7 @@ import (
"github.com/luci/luci-go/common/logging/gologger"
"github.com/luci/luci-go/common/tsmon"
"github.com/luci/luci-go/common/tsmon/monitor"
+ "github.com/luci/luci-go/server/router"
"golang.org/x/net/context"
. "github.com/smartystreets/goconvey/convey"
@@ -98,7 +99,7 @@ func TestHousekeepingHandler(t *testing.T) {
So(i.TaskNum, ShouldEqual, -1)
rec := httptest.NewRecorder()
- housekeepingHandler(c, rec, &http.Request{}, nil)
+ housekeepingHandler(&router.Context{Context: c, Writer: rec, Request: &http.Request{}, Params: nil})
So(rec.Code, ShouldEqual, http.StatusOK)
i, err = getOrCreateInstanceEntity(c)
@@ -119,7 +120,7 @@ func TestHousekeepingHandler(t *testing.T) {
getOrCreateInstanceEntity(c)
rec := httptest.NewRecorder()
- housekeepingHandler(c, rec, &http.Request{}, nil)
+ housekeepingHandler(&router.Context{Context: c, Writer: rec, Request: &http.Request{}, Params: nil})
So(rec.Code, ShouldEqual, http.StatusOK)
i, err := getOrCreateInstanceEntity(c)
@@ -144,7 +145,7 @@ func TestHousekeepingHandler(t *testing.T) {
clock.Add(instanceExpirationTimeout + time.Second)
rec := httptest.NewRecorder()
- housekeepingHandler(c, rec, &http.Request{}, nil)
+ housekeepingHandler(&router.Context{Context: c, Writer: rec, Request: &http.Request{}, Params: nil})
So(rec.Code, ShouldEqual, http.StatusOK)
exists, err = ds.Exists(ds.NewKey("Instance", "foobar", 0, nil))

Powered by Google App Engine
This is Rietveld 408576698