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

Unified Diff: service/datastore/context_test.go

Issue 1355783002: Refactor keys and queries in datastore service and implementation. (Closed) Base URL: https://github.com/luci/gae.git@master
Patch Set: Created 5 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
Index: service/datastore/context_test.go
diff --git a/service/datastore/context_test.go b/service/datastore/context_test.go
index 2f3d042866046e5fe3c4cf906f8488c4446f6a4e..059686f425048d2dff4838d95c3cecdaff5fbae4 100644
--- a/service/datastore/context_test.go
+++ b/service/datastore/context_test.go
@@ -22,8 +22,14 @@ type fakeService struct{ RawInterface }
type fakeFilt struct{ RawInterface }
-func (fakeFilt) NewKey(kind, stringID string, intID int64, parent Key) Key {
- return mkKey("aid", "ns", "filteredKind", "")
+func (f fakeService) DecodeCursor(s string) (Cursor, error) {
+ return fakeCursor(s), nil
+}
+
+type fakeCursor string
+
+func (f fakeCursor) String() string {
+ return string(f)
}
func TestServices(t *testing.T) {
@@ -47,8 +53,9 @@ func TestServices(t *testing.T) {
return fakeFilt{rds}
})
- k := Get(c).NewKey("Kind", "", 1, nil)
- So(k.Kind(), ShouldEqual, "filteredKind")
+ curs, err := Get(c).DecodeCursor("pants")
+ So(err, ShouldBeNil)
+ So(curs.String(), ShouldEqual, "pants")
})
})
Convey("adding zero filters does nothing", func() {

Powered by Google App Engine
This is Rietveld 408576698