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

Unified Diff: service/datastore/checkfilter_test.go

Issue 1292913002: Split off serialization and key functions to their own packages. (Closed) Base URL: https://github.com/luci/gae.git@make_queries_better
Patch Set: rebase 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/checkfilter.go ('k') | service/datastore/context_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: service/datastore/checkfilter_test.go
diff --git a/service/datastore/checkfilter_test.go b/service/datastore/checkfilter_test.go
index 445b9d0aec03e0c7dc6bf5361fe1cc4a27d2a6f9..550c8795f90abe2e30248a849016fc49119d0bfd 100644
--- a/service/datastore/checkfilter_test.go
+++ b/service/datastore/checkfilter_test.go
@@ -59,16 +59,16 @@ func TestCheckFilter(t *testing.T) {
Convey("GetMulti", func() {
So(rds.GetMulti(nil, nil, nil), ShouldBeNil)
- So(rds.GetMulti([]Key{NewKey("", "", "", "", 0, nil)}, nil, nil).Error(), ShouldContainSubstring, "is nil")
+ So(rds.GetMulti([]Key{mkKey("", "", "", "")}, nil, nil).Error(), ShouldContainSubstring, "is nil")
// this is in the wrong aid/ns
- keys := []Key{NewKey("wut", "wrong", "Kind", "", 1, nil)}
+ keys := []Key{mkKey("wut", "wrong", "Kind", 1)}
So(rds.GetMulti(keys, nil, func(pm PropertyMap, err error) {
So(pm, ShouldBeNil)
So(err, ShouldEqual, ErrInvalidKey)
}), ShouldBeNil)
- keys[0] = NewKey("aid", "ns", "Kind", "", 1, nil)
+ keys[0] = mkKey("aid", "ns", "Kind", 1)
hit := false
So(func() {
rds.GetMulti(keys, nil, func(pm PropertyMap, err error) {
@@ -85,8 +85,8 @@ func TestCheckFilter(t *testing.T) {
ShouldContainSubstring, "mismatched keys/vals")
So(rds.PutMulti(nil, nil, nil), ShouldBeNil)
- badParent := NewKey("aid", "ns", "Wut", "", 0, nil)
- keys = append(keys, NewKey("aid", "ns", "Kind", "", 0, badParent))
+ badParent := mkKey("aid", "ns", "Wut", 0)
+ keys = append(keys, mkKey("aid", "ns", "Kind", 0, badParent))
So(rds.PutMulti(keys, vals, nil).Error(), ShouldContainSubstring, "callback is nil")
So(rds.PutMulti(keys, vals, func(k Key, err error) {
@@ -94,7 +94,7 @@ func TestCheckFilter(t *testing.T) {
So(err, ShouldEqual, ErrInvalidKey)
}), ShouldBeNil)
- keys = []Key{NewKey("aid", "ns", "Kind", "", 0, nil)}
+ keys = []Key{mkKey("aid", "ns", "Kind", 0)}
vals = []PropertyMap{nil}
So(rds.PutMulti(keys, vals, func(k Key, err error) {
So(k, ShouldBeNil)
@@ -113,14 +113,14 @@ func TestCheckFilter(t *testing.T) {
Convey("DeleteMulti", func() {
So(rds.DeleteMulti(nil, nil), ShouldBeNil)
- So(rds.DeleteMulti([]Key{NewKey("", "", "", "", 0, nil)}, nil).Error(), ShouldContainSubstring, "is nil")
- So(rds.DeleteMulti([]Key{NewKey("", "", "", "", 0, nil)}, func(err error) {
+ So(rds.DeleteMulti([]Key{mkKey("", "", "", "")}, nil).Error(), ShouldContainSubstring, "is nil")
+ So(rds.DeleteMulti([]Key{mkKey("", "", "", "")}, func(err error) {
So(err, ShouldEqual, ErrInvalidKey)
}), ShouldBeNil)
hit := false
So(func() {
- rds.DeleteMulti([]Key{NewKey("aid", "ns", "Kind", "", 1, nil)}, func(error) {
+ rds.DeleteMulti([]Key{mkKey("aid", "ns", "Kind", 1)}, func(error) {
hit = true
})
}, ShouldPanic)
« no previous file with comments | « service/datastore/checkfilter.go ('k') | service/datastore/context_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698