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

Unified Diff: go/src/infra/appengine/sheriff-o-matic/main_test.go

Issue 2058173003: [som] Add revision range exapansion. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: no-message:) 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: go/src/infra/appengine/sheriff-o-matic/main_test.go
diff --git a/go/src/infra/appengine/sheriff-o-matic/main_test.go b/go/src/infra/appengine/sheriff-o-matic/main_test.go
index efc3912e658d09435d6dd1e038936c91cd13660f..5b2d796700dc4869eb7ce11287dd2fdfdc6f20ee 100644
--- a/go/src/infra/appengine/sheriff-o-matic/main_test.go
+++ b/go/src/infra/appengine/sheriff-o-matic/main_test.go
@@ -17,6 +17,7 @@ import (
"github.com/julienschmidt/httprouter"
"github.com/luci/gae/service/datastore"
+ "github.com/luci/gae/service/urlfetch"
"github.com/luci/luci-go/appengine/gaetesting"
"github.com/luci/luci-go/common/clock"
"github.com/luci/luci-go/common/clock/testclock"
@@ -361,3 +362,29 @@ func TestWriteSettings(t *testing.T) {
})
})
}
+
+func TestRevRangeHandler(t *testing.T) {
+ t.Parallel()
+
+ Convey("get rev range", t, func() {
+ Convey("ok", func() {
+ c := gaetesting.TestingContext()
+ w := httptest.NewRecorder()
+ c = urlfetch.Set(c, http.DefaultTransport)
+
+ getRevRangeHandler(c, w, makeGetRequest(),
+ makeParams("start", "123", "end", "456"))
+
+ So(w.Code, ShouldEqual, 301)
+ })
+ Convey("bad request", func() {
+ c := gaetesting.TestingContext()
+ w := httptest.NewRecorder()
+ c = urlfetch.Set(c, http.DefaultTransport)
+
+ getRevRangeHandler(c, w, makeGetRequest(), nil)
+
+ So(w.Code, ShouldEqual, 400)
+ })
+ })
+}
« no previous file with comments | « go/src/infra/appengine/sheriff-o-matic/main.go ('k') | go/src/infra/appengine/sheriff-o-matic/sheriff-o-matic.infra_testing » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698