| Index: impl/dummy/dummy_test.go
|
| diff --git a/dummy/dummy_test.go b/impl/dummy/dummy_test.go
|
| similarity index 56%
|
| rename from dummy/dummy_test.go
|
| rename to impl/dummy/dummy_test.go
|
| index cc907e7137e4609a0fc354ca5cb6e1f944f16c24..dcb9eb65de0fd0e27d8b29885a35afadf4017686 100644
|
| --- a/dummy/dummy_test.go
|
| +++ b/impl/dummy/dummy_test.go
|
| @@ -7,7 +7,10 @@ package dummy
|
| import (
|
| "testing"
|
|
|
| - "github.com/luci/gae"
|
| + infoS "github.com/luci/gae/service/info"
|
| + mcS "github.com/luci/gae/service/memcache"
|
| + rdsS "github.com/luci/gae/service/rawdatastore"
|
| + tqS "github.com/luci/gae/service/taskqueue"
|
| . "github.com/smartystreets/goconvey/convey"
|
| "golang.org/x/net/context"
|
| )
|
| @@ -25,53 +28,45 @@ func TestContextAccess(t *testing.T) {
|
| c := context.Background()
|
|
|
| Convey("blank", func() {
|
| - So(gae.GetMC(c), ShouldBeNil)
|
| - So(gae.GetTQ(c), ShouldBeNil)
|
| - So(gae.GetGI(c), ShouldBeNil)
|
| + So(mcS.Get(c), ShouldBeNil)
|
| + So(tqS.Get(c), ShouldBeNil)
|
| + So(infoS.Get(c), ShouldBeNil)
|
| })
|
|
|
| - Convey("RDS", func() {
|
| - c = gae.SetRDS(c, RDS())
|
| - So(gae.GetRDS(c), ShouldNotBeNil)
|
| + Convey("RawDatastore", func() {
|
| + c = rdsS.Set(c, RawDatastore())
|
| + So(rdsS.Get(c), ShouldNotBeNil)
|
| So(func() {
|
| defer p()
|
| - gae.GetRDS(c).NewKey("", "", 1, nil)
|
| + rdsS.Get(c).NewKey("", "", 1, nil)
|
| }, ShouldPanicWith, "dummy: method RawDatastore.NewKey is not implemented")
|
| })
|
|
|
| - Convey("MC", func() {
|
| - c = gae.SetMC(c, MC())
|
| - So(gae.GetMC(c), ShouldNotBeNil)
|
| + Convey("Memcache", func() {
|
| + c = mcS.Set(c, Memcache())
|
| + So(mcS.Get(c), ShouldNotBeNil)
|
| So(func() {
|
| defer p()
|
| - gae.GetMC(c).Add(nil)
|
| + mcS.Get(c).Add(nil)
|
| }, ShouldPanicWith, "dummy: method Memcache.Add is not implemented")
|
| })
|
|
|
| - Convey("TQ", func() {
|
| - c = gae.SetTQ(c, TQ())
|
| - So(gae.GetTQ(c), ShouldNotBeNil)
|
| + Convey("TaskQueue", func() {
|
| + c = tqS.Set(c, TaskQueue())
|
| + So(tqS.Get(c), ShouldNotBeNil)
|
| So(func() {
|
| defer p()
|
| - gae.GetTQ(c).Purge("")
|
| + tqS.Get(c).Purge("")
|
| }, ShouldPanicWith, "dummy: method TaskQueue.Purge is not implemented")
|
| })
|
|
|
| - Convey("GI", func() {
|
| - c = gae.SetGI(c, GI())
|
| - So(gae.GetGI(c), ShouldNotBeNil)
|
| + Convey("Info", func() {
|
| + c = infoS.Set(c, Info())
|
| + So(infoS.Get(c), ShouldNotBeNil)
|
| So(func() {
|
| defer p()
|
| - gae.GetGI(c).Datacenter()
|
| - }, ShouldPanicWith, "dummy: method GlobalInfo.Datacenter is not implemented")
|
| - })
|
| -
|
| - Convey("QY", func() {
|
| - q := QY()
|
| - So(func() {
|
| - defer p()
|
| - q.Distinct()
|
| - }, ShouldPanicWith, "dummy: method DSQuery.Distinct is not implemented")
|
| + infoS.Get(c).Datacenter()
|
| + }, ShouldPanicWith, "dummy: method Info.Datacenter is not implemented")
|
| })
|
| })
|
| }
|
|
|