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

Side by Side Diff: service/datastore/datastore_test.go

Issue 1494223002: Add API to allow you to get the non-transactional datastore or taskqueue. (Closed) Base URL: https://github.com/luci/gae.git@master
Patch Set: fix doc and naming Created 5 years 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 unified diff | Download patch
« no previous file with comments | « service/datastore/context.go ('k') | service/taskqueue/context.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // adapted from github.com/golang/appengine/datastore 5 // adapted from github.com/golang/appengine/datastore
6 6
7 package datastore 7 package datastore
8 8
9 import ( 9 import (
10 "fmt" 10 "fmt"
11 "testing" 11 "testing"
12 12
13 "github.com/luci/gae/service/info" 13 "github.com/luci/gae/service/info"
14 "github.com/luci/luci-go/common/errors" 14 "github.com/luci/luci-go/common/errors"
15 . "github.com/luci/luci-go/common/testing/assertions" 15 . "github.com/luci/luci-go/common/testing/assertions"
16 . "github.com/smartystreets/goconvey/convey" 16 . "github.com/smartystreets/goconvey/convey"
17 "golang.org/x/net/context" 17 "golang.org/x/net/context"
18 ) 18 )
19 19
20 func fakeDatastoreFactory(c context.Context) RawInterface { 20 func fakeDatastoreFactory(c context.Context, wantTxn bool) RawInterface {
21 i := info.Get(c) 21 i := info.Get(c)
22 return &fakeDatastore{ 22 return &fakeDatastore{
23 aid: i.FullyQualifiedAppID(), 23 aid: i.FullyQualifiedAppID(),
24 ns: i.GetNamespace(), 24 ns: i.GetNamespace(),
25 } 25 }
26 } 26 }
27 27
28 type fakeDatastore struct { 28 type fakeDatastore struct {
29 RawInterface 29 RawInterface
30 aid string 30 aid string
(...skipping 884 matching lines...) Expand 10 before | Expand all | Expand 10 after
915 So(ds.Run(q, func(k *Key, _ CursorCB) bool { 915 So(ds.Run(q, func(k *Key, _ CursorCB) bool {
916 So(k.IntID(), ShouldEqual, i+1) 916 So(k.IntID(), ShouldEqual, i+1)
917 i++ 917 i++
918 return true 918 return true
919 }), ShouldBeNil) 919 }), ShouldBeNil)
920 }) 920 })
921 921
922 }) 922 })
923 }) 923 })
924 } 924 }
OLDNEW
« no previous file with comments | « service/datastore/context.go ('k') | service/taskqueue/context.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698