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 "sort" | 9 "sort" |
10 "testing" | 10 "testing" |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 Convey(`An empty query will return all log streams.`, func() { | 162 Convey(`An empty query will return all log streams.`, func() { |
163 resp, err := svr.Query(c, &req) | 163 resp, err := svr.Query(c, &req) |
164 So(err, ShouldBeRPCOK) | 164 So(err, ShouldBeRPCOK) |
165 So(resp, shouldHaveLogPaths, streamPaths) | 165 So(resp, shouldHaveLogPaths, streamPaths) |
166 }) | 166 }) |
167 | 167 |
168 Convey(`An empty query to a non-existent project fails with NotF
ound.`, func() { | 168 Convey(`An empty query to a non-existent project fails with NotF
ound.`, func() { |
169 req.Project = "does-not-exist" | 169 req.Project = "does-not-exist" |
170 | 170 |
171 _, err := svr.Query(c, &req) | 171 _, err := svr.Query(c, &req) |
172 » » » So(err, ShouldBeRPCNotFound) | 172 » » » So(err, ShouldBeRPCPermissionDenied) |
173 }) | 173 }) |
174 | 174 |
175 » » Convey(`An empty query to a project without access fails with No
tFound.`, func() { | 175 » » Convey(`An empty query to a project without access fails with Pe
rmissionDenied.`, func() { |
176 req.Project = "proj-exclusive" | 176 req.Project = "proj-exclusive" |
177 | 177 |
178 _, err := svr.Query(c, &req) | 178 _, err := svr.Query(c, &req) |
179 » » » So(err, ShouldBeRPCNotFound) | 179 » » » So(err, ShouldBeRPCPermissionDenied) |
180 }) | 180 }) |
181 | 181 |
182 Convey(`An empty query will include purged streams if admin.`, f
unc() { | 182 Convey(`An empty query will include purged streams if admin.`, f
unc() { |
183 env.JoinGroup("admin") | 183 env.JoinGroup("admin") |
184 | 184 |
185 resp, err := svr.Query(c, &req) | 185 resp, err := svr.Query(c, &req) |
186 So(err, ShouldBeRPCOK) | 186 So(err, ShouldBeRPCOK) |
187 So(resp, shouldHaveLogPaths, purgedStreamPaths) | 187 So(resp, shouldHaveLogPaths, purgedStreamPaths) |
188 }) | 188 }) |
189 | 189 |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 | 443 |
444 Convey(`When an invalid tag is specified, returns BadReq
uest error`, func() { | 444 Convey(`When an invalid tag is specified, returns BadReq
uest error`, func() { |
445 req.Tags["+++not a valid tag+++"] = "" | 445 req.Tags["+++not a valid tag+++"] = "" |
446 | 446 |
447 _, err := svr.Query(c, &req) | 447 _, err := svr.Query(c, &req) |
448 So(err, ShouldBeRPCInvalidArgument, "invalid tag
constraint") | 448 So(err, ShouldBeRPCInvalidArgument, "invalid tag
constraint") |
449 }) | 449 }) |
450 }) | 450 }) |
451 }) | 451 }) |
452 } | 452 } |
OLD | NEW |