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

Unified Diff: dummy/dummy_test.go

Issue 1243323002: Refactor a bit. (Closed) Base URL: https://github.com/luci/gae.git@master
Patch Set: fix golint Created 5 years, 5 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 | « dummy/dummy.go ('k') | filters/count/count_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dummy/dummy_test.go
diff --git a/dummy/dummy_test.go b/dummy/dummy_test.go
deleted file mode 100644
index cc907e7137e4609a0fc354ca5cb6e1f944f16c24..0000000000000000000000000000000000000000
--- a/dummy/dummy_test.go
+++ /dev/null
@@ -1,77 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-package dummy
-
-import (
- "testing"
-
- "github.com/luci/gae"
- . "github.com/smartystreets/goconvey/convey"
- "golang.org/x/net/context"
-)
-
-func TestContextAccess(t *testing.T) {
- t.Parallel()
-
- // p is a function which recovers an error and then immediately panics with
- // the contained string. It's defer'd in each test so that we can use the
- // ShouldPanicWith assertion (which does an == comparison and not
- // a reflect.DeepEquals comparison).
- p := func() { panic(recover().(error).Error()) }
-
- Convey("Context Access", t, func() {
- c := context.Background()
-
- Convey("blank", func() {
- So(gae.GetMC(c), ShouldBeNil)
- So(gae.GetTQ(c), ShouldBeNil)
- So(gae.GetGI(c), ShouldBeNil)
- })
-
- Convey("RDS", func() {
- c = gae.SetRDS(c, RDS())
- So(gae.GetRDS(c), ShouldNotBeNil)
- So(func() {
- defer p()
- gae.GetRDS(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)
- So(func() {
- defer p()
- gae.GetMC(c).Add(nil)
- }, ShouldPanicWith, "dummy: method Memcache.Add is not implemented")
- })
-
- Convey("TQ", func() {
- c = gae.SetTQ(c, TQ())
- So(gae.GetTQ(c), ShouldNotBeNil)
- So(func() {
- defer p()
- gae.GetTQ(c).Purge("")
- }, ShouldPanicWith, "dummy: method TaskQueue.Purge is not implemented")
- })
-
- Convey("GI", func() {
- c = gae.SetGI(c, GI())
- So(gae.GetGI(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")
- })
- })
-}
« no previous file with comments | « dummy/dummy.go ('k') | filters/count/count_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698