| OLD | NEW |
| 1 // Copyright 2015 The LUCI Authors. All rights reserved. | 1 // Copyright 2015 The LUCI Authors. All rights reserved. |
| 2 // Use of this source code is governed under the Apache License, Version 2.0 | 2 // Use of this source code is governed under the Apache License, Version 2.0 |
| 3 // that can be found in the LICENSE file. | 3 // that can be found in the LICENSE file. |
| 4 | 4 |
| 5 package coordinator | 5 package coordinator |
| 6 | 6 |
| 7 import ( | 7 import ( |
| 8 "errors" | 8 "errors" |
| 9 "fmt" | 9 "fmt" |
| 10 "testing" | 10 "testing" |
| 11 | 11 |
| 12 "github.com/luci/luci-go/common/clock/testclock" | 12 "github.com/luci/luci-go/common/clock/testclock" |
| 13 "github.com/luci/luci-go/common/proto/google" | 13 "github.com/luci/luci-go/common/proto/google" |
| 14 "github.com/luci/luci-go/common/testing/prpctest" | 14 "github.com/luci/luci-go/common/testing/prpctest" |
| 15 "github.com/luci/luci-go/grpc/grpcutil" | 15 "github.com/luci/luci-go/grpc/grpcutil" |
| 16 "github.com/luci/luci-go/logdog/api/endpoints/coordinator/logs/v1" | 16 "github.com/luci/luci-go/logdog/api/endpoints/coordinator/logs/v1" |
| 17 "github.com/luci/luci-go/logdog/api/logpb" | 17 "github.com/luci/luci-go/logdog/api/logpb" |
| 18 "github.com/luci/luci-go/luci_config/common/cfgtypes" | 18 "github.com/luci/luci-go/luci_config/common/cfgtypes" |
| 19 |
| 19 "golang.org/x/net/context" | 20 "golang.org/x/net/context" |
| 20 | 21 |
| 21 . "github.com/smartystreets/goconvey/convey" | 22 . "github.com/smartystreets/goconvey/convey" |
| 22 ) | 23 ) |
| 23 | 24 |
| 24 type testQueryLogsService struct { | 25 type testQueryLogsService struct { |
| 25 testLogsServiceBase | 26 testLogsServiceBase |
| 26 | 27 |
| 27 LR logdog.QueryRequest | 28 LR logdog.QueryRequest |
| 28 H func(*logdog.QueryRequest) (*logdog.QueryResponse, error) | 29 H func(*logdog.QueryRequest) (*logdog.QueryResponse, error) |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 Convey(`Will return ErrNoAccess if permission denied.`,
func() { | 218 Convey(`Will return ErrNoAccess if permission denied.`,
func() { |
| 218 svc.H = func(*logdog.QueryRequest) (*logdog.Quer
yResponse, error) { | 219 svc.H = func(*logdog.QueryRequest) (*logdog.Quer
yResponse, error) { |
| 219 return nil, grpcutil.Unauthenticated | 220 return nil, grpcutil.Unauthenticated |
| 220 } | 221 } |
| 221 | 222 |
| 222 So(client.Query(c, project, path, q, accumulate)
, ShouldEqual, ErrNoAccess) | 223 So(client.Query(c, project, path, q, accumulate)
, ShouldEqual, ErrNoAccess) |
| 223 }) | 224 }) |
| 224 }) | 225 }) |
| 225 }) | 226 }) |
| 226 } | 227 } |
| OLD | NEW |