| OLD | NEW |
| 1 // Copyright 2016 The LUCI Authors. All rights reserved. | 1 // Copyright 2016 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 cloud | 5 package cloud |
| 6 | 6 |
| 7 import ( | 7 import ( |
| 8 "crypto/rand" | 8 "crypto/rand" |
| 9 "encoding/hex" | 9 "encoding/hex" |
| 10 "fmt" | 10 "fmt" |
| 11 "os" | 11 "os" |
| 12 "testing" | 12 "testing" |
| 13 "time" | 13 "time" |
| 14 | 14 |
| 15 ds "github.com/luci/gae/service/datastore" | 15 ds "github.com/luci/gae/service/datastore" |
| 16 "github.com/luci/gae/service/info" | 16 "github.com/luci/gae/service/info" |
| 17 | 17 |
| 18 "cloud.google.com/go/datastore" |
| 18 "github.com/luci/luci-go/common/errors" | 19 "github.com/luci/luci-go/common/errors" |
| 19 "golang.org/x/net/context" | 20 "golang.org/x/net/context" |
| 20 "google.golang.org/cloud/datastore" | |
| 21 | 21 |
| 22 . "github.com/smartystreets/goconvey/convey" | 22 . "github.com/smartystreets/goconvey/convey" |
| 23 ) | 23 ) |
| 24 | 24 |
| 25 func mkProperties(index bool, vals ...interface{}) []ds.Property { | 25 func mkProperties(index bool, vals ...interface{}) []ds.Property { |
| 26 indexSetting := ds.ShouldIndex | 26 indexSetting := ds.ShouldIndex |
| 27 if !index { | 27 if !index { |
| 28 indexSetting = ds.NoIndex | 28 indexSetting = ds.NoIndex |
| 29 } | 29 } |
| 30 | 30 |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 pmap := ds.PropertyMap{"$kind": mkp("Tes
t"), "$id": mkp("quux")} | 285 pmap := ds.PropertyMap{"$kind": mkp("Tes
t"), "$id": mkp("quux")} |
| 286 err = di.RunInTransaction(func(c context
.Context) error { | 286 err = di.RunInTransaction(func(c context
.Context) error { |
| 287 return ds.Get(c).Get(pmap) | 287 return ds.Get(c).Get(pmap) |
| 288 }, nil) | 288 }, nil) |
| 289 So(err, ShouldEqual, ds.ErrNoSuchEntity) | 289 So(err, ShouldEqual, ds.ErrNoSuchEntity) |
| 290 }) | 290 }) |
| 291 }) | 291 }) |
| 292 }) | 292 }) |
| 293 }) | 293 }) |
| 294 } | 294 } |
| OLD | NEW |