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

Unified Diff: filter/count/count_test.go

Issue 1530533002: Add filters for user service. (Closed) Base URL: https://github.com/luci/gae.git@master
Patch Set: bug Created 5 years 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 | « no previous file | filter/count/user.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: filter/count/count_test.go
diff --git a/filter/count/count_test.go b/filter/count/count_test.go
index 0a67a774229c1a767a77c13edc279bc0b0458190..e77980f4a58f57da50a900abbf8bda43c5cb41ba 100644
--- a/filter/count/count_test.go
+++ b/filter/count/count_test.go
@@ -14,6 +14,7 @@ import (
"github.com/luci/gae/service/info"
"github.com/luci/gae/service/memcache"
"github.com/luci/gae/service/taskqueue"
+ "github.com/luci/gae/service/user"
. "github.com/luci/luci-go/common/testing/assertions"
. "github.com/smartystreets/goconvey/convey"
"golang.org/x/net/context"
@@ -140,6 +141,23 @@ func TestCount(t *testing.T) {
So(ctr.Namespace, shouldHaveSuccessesAndErrors, 1, 1)
})
+
+ Convey("works for user", t, func() {
+ c, fb := featureBreaker.FilterUser(memory.Use(context.Background()), nil)
+ c, ctr := FilterUser(c)
+ So(c, ShouldNotBeNil)
+ So(ctr, ShouldNotBeNil)
+
+ u := user.Get(c)
+
+ _, err := u.CurrentOAuth("foo")
+ die(err)
+ fb.BreakFeatures(nil, "CurrentOAuth")
+ _, err = u.CurrentOAuth("foo")
+ So(err, ShouldErrLike, `"CurrentOAuth" is broken`)
+
+ So(ctr.CurrentOAuth, shouldHaveSuccessesAndErrors, 1, 1)
+ })
}
func ExampleFilterRDS() {
« no previous file with comments | « no previous file | filter/count/user.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698