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

Unified Diff: service/datastore/context_test.go

Issue 1259593005: Add 'user friendly' datastore API. (Closed) Base URL: https://github.com/luci/gae.git@master
Patch Set: more docs Created 5 years, 4 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/context.go ('k') | service/datastore/datastore.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: service/datastore/context_test.go
diff --git a/service/datastore/context_test.go b/service/datastore/context_test.go
index b13f2278d663f63187eedd95f026bd645476ee41..d1684c1a2517715c11114651a06da877e4294804 100644
--- a/service/datastore/context_test.go
+++ b/service/datastore/context_test.go
@@ -17,9 +17,9 @@ type fakeInfo struct{ info.Interface }
func (fakeInfo) GetNamespace() string { return "ns" }
func (fakeInfo) AppID() string { return "aid" }
-type fakeService struct{ Interface }
+type fakeService struct{ RawInterface }
-type fakeFilt struct{ Interface }
+type fakeFilt struct{ RawInterface }
func (fakeFilt) NewKey(kind, stringID string, intID int64, parent Key) Key {
return NewKey("aid", "ns", kind, stringID, intID, parent)
@@ -31,18 +31,18 @@ func TestServices(t *testing.T) {
Convey("Test service interfaces", t, func() {
c := context.Background()
Convey("without adding anything", func() {
- So(Get(c), ShouldBeNil)
+ So(GetRaw(c), ShouldBeNil)
})
Convey("adding a basic implementation", func() {
- c = Set(info.Set(c, fakeInfo{}), fakeService{})
+ c = SetRaw(info.Set(c, fakeInfo{}), fakeService{})
Convey("lets you pull them back out", func() {
- So(Get(c), ShouldResemble, &checkFilter{fakeService{}, "aid", "ns"})
+ So(GetRaw(c), ShouldResemble, &checkFilter{fakeService{}, "aid", "ns"})
})
Convey("and lets you add filters", func() {
- c = AddFilters(c, func(ic context.Context, rds Interface) Interface {
+ c = AddRawFilters(c, func(ic context.Context, rds RawInterface) RawInterface {
return fakeFilt{rds}
})
@@ -51,7 +51,7 @@ func TestServices(t *testing.T) {
})
})
Convey("adding zero filters does nothing", func() {
- So(AddFilters(c), ShouldEqual, c)
+ So(AddRawFilters(c), ShouldEqual, c)
})
})
}
« no previous file with comments | « service/datastore/context.go ('k') | service/datastore/datastore.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698