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

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

Issue 1500433002: Add User service. (Closed) Base URL: https://github.com/luci/gae.git@inner_ctx
Patch Set: method Created 5 years 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
« no previous file with comments | « impl/dummy/dummy.go ('k') | impl/prod/context.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 dsS "github.com/luci/gae/service/datastore" 10 dsS "github.com/luci/gae/service/datastore"
11 infoS "github.com/luci/gae/service/info" 11 infoS "github.com/luci/gae/service/info"
12 mcS "github.com/luci/gae/service/memcache" 12 mcS "github.com/luci/gae/service/memcache"
13 tqS "github.com/luci/gae/service/taskqueue" 13 tqS "github.com/luci/gae/service/taskqueue"
14 userS "github.com/luci/gae/service/user"
14 . "github.com/smartystreets/goconvey/convey" 15 . "github.com/smartystreets/goconvey/convey"
15 "golang.org/x/net/context" 16 "golang.org/x/net/context"
16 ) 17 )
17 18
18 func TestContextAccess(t *testing.T) { 19 func TestContextAccess(t *testing.T) {
19 t.Parallel() 20 t.Parallel()
20 21
21 // p is a function which recovers an error and then immediately panics w ith 22 // p is a function which recovers an error and then immediately panics w ith
22 // the contained string. It's defer'd in each test so that we can use th e 23 // the contained string. It's defer'd in each test so that we can use th e
23 // ShouldPanicWith assertion (which does an == comparison and not 24 // ShouldPanicWith assertion (which does an == comparison and not
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 66
66 Convey("TaskQueue", func() { 67 Convey("TaskQueue", func() {
67 c = tqS.SetRaw(c, TaskQueue()) 68 c = tqS.SetRaw(c, TaskQueue())
68 So(tqS.Get(c), ShouldNotBeNil) 69 So(tqS.Get(c), ShouldNotBeNil)
69 So(func() { 70 So(func() {
70 defer p() 71 defer p()
71 _ = tqS.Get(c).Purge("") 72 _ = tqS.Get(c).Purge("")
72 }, ShouldPanicWith, "dummy: method TaskQueue.Purge is no t implemented") 73 }, ShouldPanicWith, "dummy: method TaskQueue.Purge is no t implemented")
73 }) 74 })
74 75
76 Convey("User", func() {
77 c = userS.Set(c, User())
78 So(userS.Get(c), ShouldNotBeNil)
79 So(func() {
80 defer p()
81 _ = userS.Get(c).IsAdmin()
82 }, ShouldPanicWith, "dummy: method User.IsAdmin is not i mplemented")
83 })
84
75 }) 85 })
76 } 86 }
OLDNEW
« no previous file with comments | « impl/dummy/dummy.go ('k') | impl/prod/context.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698