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() { |