OLD | NEW |
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 mailS "github.com/luci/gae/service/mail" |
12 mcS "github.com/luci/gae/service/memcache" | 13 mcS "github.com/luci/gae/service/memcache" |
13 tqS "github.com/luci/gae/service/taskqueue" | 14 tqS "github.com/luci/gae/service/taskqueue" |
14 userS "github.com/luci/gae/service/user" | 15 userS "github.com/luci/gae/service/user" |
15 . "github.com/smartystreets/goconvey/convey" | 16 . "github.com/smartystreets/goconvey/convey" |
16 "golang.org/x/net/context" | 17 "golang.org/x/net/context" |
17 ) | 18 ) |
18 | 19 |
19 func TestContextAccess(t *testing.T) { | 20 func TestContextAccess(t *testing.T) { |
20 t.Parallel() | 21 t.Parallel() |
21 | 22 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 | 76 |
76 Convey("User", func() { | 77 Convey("User", func() { |
77 c = userS.Set(c, User()) | 78 c = userS.Set(c, User()) |
78 So(userS.Get(c), ShouldNotBeNil) | 79 So(userS.Get(c), ShouldNotBeNil) |
79 So(func() { | 80 So(func() { |
80 defer p() | 81 defer p() |
81 _ = userS.Get(c).IsAdmin() | 82 _ = userS.Get(c).IsAdmin() |
82 }, ShouldPanicWith, "dummy: method User.IsAdmin is not i
mplemented") | 83 }, ShouldPanicWith, "dummy: method User.IsAdmin is not i
mplemented") |
83 }) | 84 }) |
84 | 85 |
| 86 Convey("Mail", func() { |
| 87 c = mailS.Set(c, Mail()) |
| 88 So(mailS.Get(c), ShouldNotBeNil) |
| 89 So(func() { |
| 90 defer p() |
| 91 _ = mailS.Get(c).Send(nil) |
| 92 }, ShouldPanicWith, "dummy: method Mail.Send is not impl
emented") |
| 93 }) |
| 94 |
85 }) | 95 }) |
86 } | 96 } |
OLD | NEW |