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

Unified Diff: filter/dscache/dscache_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 | « filter/dscache/dscache.go ('k') | filter/dscache/serialize.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: filter/dscache/dscache_test.go
diff --git a/filter/dscache/dscache_test.go b/filter/dscache/dscache_test.go
index a3fa0350ddd27100c3f1117fca178bf3f8982d16..6b0240d04f4f2f90c5785e9b586c83d9d85f9fba 100644
--- a/filter/dscache/dscache_test.go
+++ b/filter/dscache/dscache_test.go
@@ -15,6 +15,7 @@ import (
"github.com/luci/gae/filter/featureBreaker"
"github.com/luci/gae/impl/memory"
"github.com/luci/gae/service/datastore"
+ "github.com/luci/gae/service/datastore/serialize"
"github.com/luci/gae/service/memcache"
"github.com/luci/luci-go/common/clock"
"github.com/luci/luci-go/common/clock/testclock"
@@ -43,7 +44,7 @@ type noCacheObj struct { // see shardsForKey() at top
}
func init() {
- datastore.WritePropertyMapDeterministic = true
+ serialize.WritePropertyMapDeterministic = true
internalValueSizeLimit = 2048
}
@@ -97,9 +98,7 @@ func TestDSCache(t *testing.T) {
"BigData": {datastore.MkProperty([]byte(""))},
"Value": {datastore.MkProperty("hi")},
}
- buf := &bytes.Buffer{}
- So(pm.Write(buf, datastore.WithoutContext), ShouldBeNil)
- encoded := append([]byte{0}, buf.Bytes()...)
+ encoded := append([]byte{0}, serialize.ToBytes(pm)...)
o := object{ID: 1, Value: "hi"}
So(ds.Put(&o), ShouldBeNil)
« no previous file with comments | « filter/dscache/dscache.go ('k') | filter/dscache/serialize.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698