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

Unified Diff: filter/featureBreaker/featurebreaker_test.go

Issue 2302743002: Interface update, per-method Contexts. (Closed)
Patch Set: Lightning talk licenses. Created 4 years, 3 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
« no previous file with comments | « filter/dscache/support.go ('k') | filter/featureBreaker/gi.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: filter/featureBreaker/featurebreaker_test.go
diff --git a/filter/featureBreaker/featurebreaker_test.go b/filter/featureBreaker/featurebreaker_test.go
index 70589974634eed19cbab3f76dc04410b8a9ec686..e38951f06c9d493128fcaf82a564c0e13579fbd5 100644
--- a/filter/featureBreaker/featurebreaker_test.go
+++ b/filter/featureBreaker/featurebreaker_test.go
@@ -8,10 +8,12 @@ import (
"testing"
"github.com/luci/gae/impl/memory"
- "github.com/luci/gae/service/datastore"
+ ds "github.com/luci/gae/service/datastore"
"github.com/luci/luci-go/common/errors"
- . "github.com/smartystreets/goconvey/convey"
+
"golang.org/x/net/context"
+
+ . "github.com/smartystreets/goconvey/convey"
)
func TestBrokenFeatures(t *testing.T) {
@@ -25,41 +27,39 @@ func TestBrokenFeatures(t *testing.T) {
Convey("Can break ds", func() {
Convey("without a default", func() {
c, bf := FilterRDS(c, nil)
- ds := datastore.Get(c)
- vals := []datastore.PropertyMap{{
- "$key": datastore.MkPropertyNI(ds.NewKey("Wut", "", 1, nil)),
+ vals := []ds.PropertyMap{{
+ "$key": ds.MkPropertyNI(ds.NewKey(c, "Wut", "", 1, nil)),
}}
Convey("by specifying an error", func() {
bf.BreakFeatures(e, "GetMulti", "PutMulti")
- So(ds.GetMulti(vals), ShouldEqual, e)
+ So(ds.Get(c, vals), ShouldEqual, e)
Convey("and you can unbreak them as well", func() {
bf.UnbreakFeatures("GetMulti")
- So(errors.SingleError(ds.GetMulti(vals)), ShouldEqual, datastore.ErrNoSuchEntity)
+ So(errors.SingleError(ds.Get(c, vals)), ShouldEqual, ds.ErrNoSuchEntity)
Convey("no broken features at all is a shortcut", func() {
bf.UnbreakFeatures("PutMulti")
- So(errors.SingleError(ds.GetMulti(vals)), ShouldEqual, datastore.ErrNoSuchEntity)
+ So(errors.SingleError(ds.Get(c, vals)), ShouldEqual, ds.ErrNoSuchEntity)
})
})
})
Convey("Not specifying an error gets you a generic error", func() {
bf.BreakFeatures(nil, "GetMulti")
- So(ds.GetMulti(vals).Error(), ShouldContainSubstring, `feature "GetMulti" is broken`)
+ So(ds.Get(c, vals).Error(), ShouldContainSubstring, `feature "GetMulti" is broken`)
})
})
Convey("with a default", func() {
c, bf := FilterRDS(c, e)
- ds := datastore.Get(c)
- vals := []datastore.PropertyMap{{
- "$key": datastore.MkPropertyNI(ds.NewKey("Wut", "", 1, nil)),
+ vals := []ds.PropertyMap{{
+ "$key": ds.MkPropertyNI(ds.NewKey(c, "Wut", "", 1, nil)),
}}
bf.BreakFeatures(nil, "GetMulti")
- So(ds.GetMulti(vals), ShouldEqual, e)
+ So(ds.Get(c, vals), ShouldEqual, e)
})
})
})
« no previous file with comments | « filter/dscache/support.go ('k') | filter/featureBreaker/gi.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698