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

Unified Diff: go/src/infra/gae/libs/wrapper/dummy_test.go

Issue 1222903002: Refactor current GAE abstraction library to be free of the SDK* (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: more fixes 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
Index: go/src/infra/gae/libs/wrapper/dummy_test.go
diff --git a/go/src/infra/gae/libs/wrapper/dummy_test.go b/go/src/infra/gae/libs/wrapper/dummy_test.go
deleted file mode 100644
index 61e8ab2c09228ee875d141a5982736c022460138..0000000000000000000000000000000000000000
--- a/go/src/infra/gae/libs/wrapper/dummy_test.go
+++ /dev/null
@@ -1,76 +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 wrapper
-
-import (
- "math/rand"
- "testing"
- "time"
-
- "golang.org/x/net/context"
-
- "appengine/memcache"
-
- . "github.com/smartystreets/goconvey/convey"
- "infra/libs/clock/testclock"
-)
-
-func TestContextAccess(t *testing.T) {
- Convey("Context Access", t, func() {
- now := time.Date(2015, 1, 1, 0, 0, 0, 0, time.UTC)
- c, _ := testclock.UseTime(context.Background(), now)
-
- Convey("blank", func() {
- So(GetDS(c), ShouldBeNil)
- So(GetMC(c), ShouldBeNil)
- So(GetTQ(c), ShouldBeNil)
- So(GetGI(c), ShouldBeNil)
- })
-
- Convey("DS", func() {
- c = SetDS(c, DummyDS())
- So(GetDS(c), ShouldNotBeNil)
- So(func() { GetDS(c).Kind(nil) }, ShouldPanic)
- })
-
- Convey("MC", func() {
- c = SetMC(c, DummyMC())
- So(GetMC(c), ShouldNotBeNil)
- So(func() { GetMC(c).InflateCodec(memcache.Codec{}) }, ShouldPanic)
- })
-
- Convey("TQ", func() {
- c = SetTQ(c, DummyTQ())
- So(GetTQ(c), ShouldNotBeNil)
- So(func() { GetTQ(c).Purge("") }, ShouldPanic)
- })
-
- Convey("GI", func() {
- c = SetGI(c, DummyGI())
- So(GetGI(c), ShouldNotBeNil)
- So(func() { GetGI(c).Datacenter() }, ShouldPanic)
- })
-
- Convey("QY", func() {
- q := DummyQY()
- So(func() { q.Distinct() }, ShouldPanic)
- })
-
- Convey("MathRand", func() {
- r := rand.New(rand.NewSource(now.UnixNano()))
- i := r.Int()
-
- // when it's unset it picks the current time every time
- So(GetMathRand(c).Int(), ShouldEqual, i)
- So(GetMathRand(c).Int(), ShouldEqual, i)
-
- // But we could set it to something concrete to have it persist.
- c = SetMathRand(c, rand.New(rand.NewSource(now.UnixNano())))
- r = rand.New(rand.NewSource(now.UnixNano()))
- So(GetMathRand(c).Int(), ShouldEqual, r.Int())
- So(GetMathRand(c).Int(), ShouldEqual, r.Int())
- })
- })
-}

Powered by Google App Engine
This is Rietveld 408576698