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

Unified Diff: filter/count/count_test.go

Issue 1525923002: Implement Mail service. (Closed) Base URL: https://github.com/luci/gae.git@filter_user
Patch Set: tests and words 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/mail.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 e77980f4a58f57da50a900abbf8bda43c5cb41ba..2154aa85020de6efe09a69ea49b83c0cd32b26b1 100644
--- a/filter/count/count_test.go
+++ b/filter/count/count_test.go
@@ -12,6 +12,7 @@ import (
"github.com/luci/gae/impl/memory"
"github.com/luci/gae/service/datastore"
"github.com/luci/gae/service/info"
+ "github.com/luci/gae/service/mail"
"github.com/luci/gae/service/memcache"
"github.com/luci/gae/service/taskqueue"
"github.com/luci/gae/service/user"
@@ -158,6 +159,32 @@ func TestCount(t *testing.T) {
So(ctr.CurrentOAuth, shouldHaveSuccessesAndErrors, 1, 1)
})
+
+ Convey("works for mail", t, func() {
+ c, fb := featureBreaker.FilterMail(memory.Use(context.Background()), nil)
+ c, ctr := FilterMail(c)
+ So(c, ShouldNotBeNil)
+ So(ctr, ShouldNotBeNil)
+
+ m := mail.Get(c)
+
+ err := m.Send(&mail.Message{
+ Sender: "admin@example.com",
+ To: []string{"coolDood@example.com"},
+ Body: "hi",
+ })
+ die(err)
+
+ fb.BreakFeatures(nil, "Send")
+ err = m.Send(&mail.Message{
+ Sender: "admin@example.com",
+ To: []string{"coolDood@example.com"},
+ Body: "hi",
+ })
+ So(err, ShouldErrLike, `"Send" is broken`)
+
+ So(ctr.Send, shouldHaveSuccessesAndErrors, 1, 1)
+ })
}
func ExampleFilterRDS() {
« no previous file with comments | « no previous file | filter/count/mail.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698