Index: service/datastore/serialize/serialize_test.go |
diff --git a/service/datastore/serialize/serialize_test.go b/service/datastore/serialize/serialize_test.go |
index 63f44d01b6b3b0b094cae2d2d1dce6ccfee405ae..a84368bca0dab7bbc72ffbf888c0cf9f7e318385 100644 |
--- a/service/datastore/serialize/serialize_test.go |
+++ b/service/datastore/serialize/serialize_test.go |
@@ -13,7 +13,6 @@ import ( |
"github.com/luci/gae/service/blobstore" |
ds "github.com/luci/gae/service/datastore" |
- "github.com/luci/gae/service/datastore/dskey" |
"github.com/luci/luci-go/common/cmpbin" |
. "github.com/luci/luci-go/common/testing/assertions" |
. "github.com/smartystreets/goconvey/convey" |
@@ -33,25 +32,7 @@ type dspmapTC struct { |
props ds.PropertyMap |
} |
-// TODO(riannucci): dedup with datastore/key testing file. |
-func mkKey(aid, ns string, elems ...interface{}) ds.Key { |
- if len(elems)%2 != 0 { |
- panic("odd number of tokens") |
- } |
- toks := make([]ds.KeyTok, len(elems)/2) |
- for i := 0; i < len(elems); i += 2 { |
- toks[i/2].Kind = elems[i].(string) |
- switch x := elems[i+1].(type) { |
- case string: |
- toks[i/2].StringID = x |
- case int: |
- toks[i/2].IntID = int64(x) |
- default: |
- panic("bad token id") |
- } |
- } |
- return dskey.NewToks(aid, ns, toks) |
-} |
+var mkKey = ds.MakeKey |
func mkBuf(data []byte) Buffer { |
return Invertible(bytes.NewBuffer(data)) |
@@ -62,7 +43,7 @@ func ShouldEqualKey(actual interface{}, expected ...interface{}) string { |
if len(expected) != 1 { |
return fmt.Sprintf("Assertion requires 1 expected value, got %d", len(expected)) |
} |
- if dskey.Equal(actual.(ds.Key), expected[0].(ds.Key)) { |
+ if actual.(*ds.Key).Equal(expected[0].(*ds.Key)) { |
return "" |
} |
return fmt.Sprintf("Expected: %q\nActual: %q", actual, expected[0]) |