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

Unified Diff: service/datastore/context_test.go

Issue 2302743002: Interface update, per-method Contexts. (Closed)
Patch Set: Lightning talk licenses. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « service/datastore/context.go ('k') | service/datastore/datastore.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: service/datastore/context_test.go
diff --git a/service/datastore/context_test.go b/service/datastore/context_test.go
index 9b63b40ef9c400106a65d1d933ef9cd6ba4f708c..26019f13847182745eea4cc3dd6e3773159a6e4d 100644
--- a/service/datastore/context_test.go
+++ b/service/datastore/context_test.go
@@ -8,15 +8,17 @@ import (
"testing"
"github.com/luci/gae/service/info"
- . "github.com/smartystreets/goconvey/convey"
+
"golang.org/x/net/context"
+
+ . "github.com/smartystreets/goconvey/convey"
)
-type fakeInfo struct{ info.Interface }
+type fakeInfo struct{ info.RawInterface }
-func (fakeInfo) GetNamespace() (string, bool) { return "ns", true }
-func (fakeInfo) AppID() string { return "aid" }
-func (fakeInfo) FullyQualifiedAppID() string { return "s~aid" }
+func (fakeInfo) GetNamespace() string { return "ns" }
+func (fakeInfo) AppID() string { return "aid" }
+func (fakeInfo) FullyQualifiedAppID() string { return "s~aid" }
type fakeService struct{ RawInterface }
@@ -38,14 +40,17 @@ func TestServices(t *testing.T) {
Convey("Test service interfaces", t, func() {
c := context.Background()
Convey("without adding anything", func() {
- So(GetRaw(c), ShouldBeNil)
+ So(Raw(c), ShouldBeNil)
})
Convey("adding a basic implementation", func() {
c = SetRaw(info.Set(c, fakeInfo{}), fakeService{})
Convey("lets you pull them back out", func() {
- So(GetRaw(c), ShouldResemble, &checkFilter{fakeService{}, "s~aid", "ns"})
+ So(Raw(c), ShouldResemble, &checkFilter{
+ RawInterface: fakeService{},
+ kc: KeyContext{"s~aid", "ns"},
+ })
})
Convey("and lets you add filters", func() {
@@ -53,7 +58,7 @@ func TestServices(t *testing.T) {
return fakeFilt{rds}
})
- curs, err := Get(c).DecodeCursor("pants")
+ curs, err := DecodeCursor(c, "pants")
So(err, ShouldBeNil)
So(curs.String(), ShouldEqual, "pants")
})
« no previous file with comments | « service/datastore/context.go ('k') | service/datastore/datastore.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698