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 logs | 5 package logs |
6 | 6 |
7 import ( | 7 import ( |
8 "fmt" | 8 "fmt" |
9 "testing" | 9 "testing" |
10 | 10 |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 l, err := svc.List(c, &req) | 185 l, err := svc.List(c, &req) |
186 So(err, ShouldBeRPCOK) | 186 So(err, ShouldBeRPCOK) |
187 So(listPaths(l), ShouldResemble, all[:1]
) | 187 So(listPaths(l), ShouldResemble, all[:1]
) |
188 | 188 |
189 all = all[1:] | 189 all = all[1:] |
190 req.Next = l.Next | 190 req.Next = l.Next |
191 } | 191 } |
192 }) | 192 }) |
193 }) | 193 }) |
194 | 194 |
195 » » Convey(`If the project does not exist, will return NotFound.`, f
unc() { | 195 » » Convey(`If the project does not exist, will return PermissionDen
ied.`, func() { |
196 req.Project = "does-not-exist" | 196 req.Project = "does-not-exist" |
197 | 197 |
198 _, err := svc.List(c, &req) | 198 _, err := svc.List(c, &req) |
199 » » » So(err, ShouldBeRPCNotFound) | 199 » » » So(err, ShouldBeRPCPermissionDenied) |
200 }) | 200 }) |
201 | 201 |
| 202 Convey(`If the user can't access the project, will return Permis
sionDenied.`, func() { |
| 203 req.Project = "proj-exclusive" |
| 204 |
| 205 _, err := svc.List(c, &req) |
| 206 So(err, ShouldBeRPCPermissionDenied) |
| 207 }) |
202 }) | 208 }) |
203 } | 209 } |
OLD | NEW |