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

Unified Diff: service/datastore/meta/eg_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 | « service/datastore/meta/eg.go ('k') | service/datastore/meta/namespaces.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: service/datastore/meta/eg_test.go
diff --git a/service/datastore/meta/eg_test.go b/service/datastore/meta/eg_test.go
index 3a17653045aeb863b054ca58fd7e8923f5a172c1..0a3e68d3f654931c786b0fff43b898620c40a9e2 100644
--- a/service/datastore/meta/eg_test.go
+++ b/service/datastore/meta/eg_test.go
@@ -10,9 +10,11 @@ import (
"github.com/luci/gae/filter/featureBreaker"
"github.com/luci/gae/impl/memory"
- "github.com/luci/gae/service/datastore"
- . "github.com/smartystreets/goconvey/convey"
+ ds "github.com/luci/gae/service/datastore"
+
"golang.org/x/net/context"
+
+ . "github.com/smartystreets/goconvey/convey"
)
func TestGetEntityGroupVersion(t *testing.T) {
@@ -21,27 +23,26 @@ func TestGetEntityGroupVersion(t *testing.T) {
Convey("GetEntityGroupVersion", t, func() {
c := memory.Use(context.Background())
c, fb := featureBreaker.FilterRDS(c, errors.New("INTERNAL_ERROR"))
- ds := datastore.Get(c)
- pm := datastore.PropertyMap{
- "$key": datastore.MkPropertyNI(ds.MakeKey("A", "")),
- "Val": datastore.MkProperty(10),
+ pm := ds.PropertyMap{
+ "$key": ds.MkPropertyNI(ds.MakeKey(c, "A", "")),
+ "Val": ds.MkProperty(10),
}
- So(ds.Put(pm), ShouldBeNil)
- aKey := ds.KeyForObj(pm)
+ So(ds.Put(c, pm), ShouldBeNil)
+ aKey := ds.KeyForObj(c, pm)
So(aKey, ShouldNotBeNil)
v, err := GetEntityGroupVersion(c, aKey)
So(err, ShouldBeNil)
So(v, ShouldEqual, 1)
- So(ds.Delete(aKey), ShouldBeNil)
+ So(ds.Delete(c, aKey), ShouldBeNil)
- v, err = GetEntityGroupVersion(c, ds.NewKey("madeUp", "thing", 0, aKey))
+ v, err = GetEntityGroupVersion(c, ds.NewKey(c, "madeUp", "thing", 0, aKey))
So(err, ShouldBeNil)
So(v, ShouldEqual, 2)
- v, err = GetEntityGroupVersion(c, ds.NewKey("madeUp", "thing", 0, nil))
+ v, err = GetEntityGroupVersion(c, ds.NewKey(c, "madeUp", "thing", 0, nil))
So(err, ShouldBeNil)
So(v, ShouldEqual, 0)
« no previous file with comments | « service/datastore/meta/eg.go ('k') | service/datastore/meta/namespaces.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698