| OLD | NEW |
| 1 // Copyright 2015 The LUCI Authors. All rights reserved. | 1 // Copyright 2015 The LUCI Authors. All rights reserved. |
| 2 // Use of this source code is governed under the Apache License, Version 2.0 | 2 // Use of this source code is governed under the Apache License, Version 2.0 |
| 3 // that can be found in the LICENSE file. | 3 // that can be found in the LICENSE file. |
| 4 | 4 |
| 5 package memory | 5 package memory |
| 6 | 6 |
| 7 import ( | 7 import ( |
| 8 "fmt" | 8 "fmt" |
| 9 "strings" | 9 "strings" |
| 10 "testing" | 10 "testing" |
| 11 "time" | 11 "time" |
| 12 | 12 |
| 13 "github.com/luci/gae/service/blobstore" | 13 "github.com/luci/gae/service/blobstore" |
| 14 ds "github.com/luci/gae/service/datastore" | 14 ds "github.com/luci/gae/service/datastore" |
| 15 "github.com/luci/gae/service/info" | 15 "github.com/luci/gae/service/info" |
| 16 "golang.org/x/net/context" | 16 "golang.org/x/net/context" |
| 17 | 17 |
| 18 . "github.com/luci/luci-go/common/testing/assertions" | 18 . "github.com/luci/luci-go/common/testing/assertions" |
| 19 . "github.com/smartystreets/goconvey/convey" | 19 . "github.com/smartystreets/goconvey/convey" |
| 20 ) | 20 ) |
| 21 | 21 |
| 22 func mkKey(appID, namespace string, elems ...interface{}) *ds.Key { | 22 func mkKey(appID, namespace string, elems ...interface{}) *ds.Key { |
| 23 » return ds.KeyContext{appID, namespace}.MakeKey(elems...) | 23 » return ds.MkKeyContext(appID, namespace).MakeKey(elems...) |
| 24 } | 24 } |
| 25 | 25 |
| 26 type qExpect struct { | 26 type qExpect struct { |
| 27 q *ds.Query | 27 q *ds.Query |
| 28 inTxn bool | 28 inTxn bool |
| 29 | 29 |
| 30 get []ds.PropertyMap | 30 get []ds.PropertyMap |
| 31 keys []*ds.Key | 31 keys []*ds.Key |
| 32 count int | 32 count int |
| 33 } | 33 } |
| (...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 633 | 633 |
| 634 v, ok := actual.(error) | 634 v, ok := actual.(error) |
| 635 if !ok { | 635 if !ok { |
| 636 return fmt.Sprintf("type of 'actual' must be error, not %T", act
ual) | 636 return fmt.Sprintf("type of 'actual' must be error, not %T", act
ual) |
| 637 } | 637 } |
| 638 if v == nil || v == ds.Stop { | 638 if v == nil || v == ds.Stop { |
| 639 return "" | 639 return "" |
| 640 } | 640 } |
| 641 return fmt.Sprintf("expected success value, not %v", v) | 641 return fmt.Sprintf("expected success value, not %v", v) |
| 642 } | 642 } |
| OLD | NEW |