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

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

Issue 2353063004: Add "MkKeyContext" KeyContext generation function. (Closed)
Patch Set: Created 4 years, 3 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 unified diff | Download patch
« no previous file with comments | « service/datastore/context.go ('k') | service/datastore/datastore_test.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 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 datastore 5 package datastore
6 6
7 import ( 7 import (
8 "testing" 8 "testing"
9 9
10 "github.com/luci/gae/service/info" 10 "github.com/luci/gae/service/info"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 Convey("without adding anything", func() { 42 Convey("without adding anything", func() {
43 So(Raw(c), ShouldBeNil) 43 So(Raw(c), ShouldBeNil)
44 }) 44 })
45 45
46 Convey("adding a basic implementation", func() { 46 Convey("adding a basic implementation", func() {
47 c = SetRaw(info.Set(c, fakeInfo{}), fakeService{}) 47 c = SetRaw(info.Set(c, fakeInfo{}), fakeService{})
48 48
49 Convey("lets you pull them back out", func() { 49 Convey("lets you pull them back out", func() {
50 So(Raw(c), ShouldResemble, &checkFilter{ 50 So(Raw(c), ShouldResemble, &checkFilter{
51 RawInterface: fakeService{}, 51 RawInterface: fakeService{},
52 » » » » » kc: KeyContext{"s~aid", "ns"}, 52 » » » » » kc: MkKeyContext("s~aid", "ns" ),
53 }) 53 })
54 }) 54 })
55 55
56 Convey("and lets you add filters", func() { 56 Convey("and lets you add filters", func() {
57 c = AddRawFilters(c, func(ic context.Context, rd s RawInterface) RawInterface { 57 c = AddRawFilters(c, func(ic context.Context, rd s RawInterface) RawInterface {
58 return fakeFilt{rds} 58 return fakeFilt{rds}
59 }) 59 })
60 60
61 curs, err := DecodeCursor(c, "pants") 61 curs, err := DecodeCursor(c, "pants")
62 So(err, ShouldBeNil) 62 So(err, ShouldBeNil)
63 So(curs.String(), ShouldEqual, "pants") 63 So(curs.String(), ShouldEqual, "pants")
64 }) 64 })
65 }) 65 })
66 Convey("adding zero filters does nothing", func() { 66 Convey("adding zero filters does nothing", func() {
67 So(AddRawFilters(c), ShouldEqual, c) 67 So(AddRawFilters(c), ShouldEqual, c)
68 }) 68 })
69 }) 69 })
70 } 70 }
OLDNEW
« no previous file with comments | « service/datastore/context.go ('k') | service/datastore/datastore_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698