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

Side by Side Diff: impl/dummy/dummy_test.go

Issue 1253263002: Make rawdatastore API safer for writing filters. (Closed) Base URL: https://github.com/luci/gae.git@master
Patch Set: avoid dummy callbacks Created 5 years, 4 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package dummy 5 package dummy
6 6
7 import ( 7 import (
8 "testing" 8 "testing"
9 9
10 infoS "github.com/luci/gae/service/info" 10 infoS "github.com/luci/gae/service/info"
(...skipping 15 matching lines...) Expand all
26 26
27 Convey("Context Access", t, func() { 27 Convey("Context Access", t, func() {
28 c := context.Background() 28 c := context.Background()
29 29
30 Convey("blank", func() { 30 Convey("blank", func() {
31 So(mcS.Get(c), ShouldBeNil) 31 So(mcS.Get(c), ShouldBeNil)
32 So(tqS.Get(c), ShouldBeNil) 32 So(tqS.Get(c), ShouldBeNil)
33 So(infoS.Get(c), ShouldBeNil) 33 So(infoS.Get(c), ShouldBeNil)
34 }) 34 })
35 35
36 // needed for everything else
37 c = infoS.Set(c, Info())
38
39 Convey("Info", func() {
40 So(infoS.Get(c), ShouldNotBeNil)
41 So(func() {
42 defer p()
43 infoS.Get(c).Datacenter()
44 }, ShouldPanicWith, "dummy: method Info.Datacenter is no t implemented")
45 })
46
36 Convey("RawDatastore", func() { 47 Convey("RawDatastore", func() {
37 c = rdsS.Set(c, RawDatastore()) 48 c = rdsS.Set(c, RawDatastore())
38 So(rdsS.Get(c), ShouldNotBeNil) 49 So(rdsS.Get(c), ShouldNotBeNil)
39 So(func() { 50 So(func() {
40 defer p() 51 defer p()
41 » » » » rdsS.Get(c).NewKey("", "", 1, nil) 52 » » » » rdsS.Get(c).DecodeKey("wut")
42 » » » }, ShouldPanicWith, "dummy: method RawDatastore.NewKey i s not implemented") 53 » » » }, ShouldPanicWith, "dummy: method RawDatastore.DecodeKe y is not implemented")
43 }) 54 })
44 55
45 Convey("Memcache", func() { 56 Convey("Memcache", func() {
46 c = mcS.Set(c, Memcache()) 57 c = mcS.Set(c, Memcache())
47 So(mcS.Get(c), ShouldNotBeNil) 58 So(mcS.Get(c), ShouldNotBeNil)
48 So(func() { 59 So(func() {
49 defer p() 60 defer p()
50 mcS.Get(c).Add(nil) 61 mcS.Get(c).Add(nil)
51 }, ShouldPanicWith, "dummy: method Memcache.Add is not i mplemented") 62 }, ShouldPanicWith, "dummy: method Memcache.Add is not i mplemented")
52 }) 63 })
53 64
54 Convey("TaskQueue", func() { 65 Convey("TaskQueue", func() {
55 c = tqS.Set(c, TaskQueue()) 66 c = tqS.Set(c, TaskQueue())
56 So(tqS.Get(c), ShouldNotBeNil) 67 So(tqS.Get(c), ShouldNotBeNil)
57 So(func() { 68 So(func() {
58 defer p() 69 defer p()
59 tqS.Get(c).Purge("") 70 tqS.Get(c).Purge("")
60 }, ShouldPanicWith, "dummy: method TaskQueue.Purge is no t implemented") 71 }, ShouldPanicWith, "dummy: method TaskQueue.Purge is no t implemented")
61 }) 72 })
62 73
63 Convey("Info", func() {
64 c = infoS.Set(c, Info())
65 So(infoS.Get(c), ShouldNotBeNil)
66 So(func() {
67 defer p()
68 infoS.Get(c).Datacenter()
69 }, ShouldPanicWith, "dummy: method Info.Datacenter is no t implemented")
70 })
71 }) 74 })
72 } 75 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698