| Index: server/config/authority_test.go
|
| diff --git a/server/config/authority_test.go b/server/config/authority_test.go
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..efccdad2b058b7b411fc4fe3e4e13b52f5c3e9a5
|
| --- /dev/null
|
| +++ b/server/config/authority_test.go
|
| @@ -0,0 +1,24 @@
|
| +// Copyright 2016 The LUCI Authors. All rights reserved.
|
| +// Use of this source code is governed under the Apache License, Version 2.0
|
| +// that can be found in the LICENSE file.
|
| +
|
| +package config
|
| +
|
| +import (
|
| + "testing"
|
| +
|
| + "github.com/luci/luci-go/server/auth"
|
| +
|
| + . "github.com/smartystreets/goconvey/convey"
|
| +)
|
| +
|
| +func TestAuthorityRPCTranslation(t *testing.T) {
|
| + t.Parallel()
|
| +
|
| + Convey(`Testing authority RPC kind translation`, t, func() {
|
| + So(AsAnonymous.rpcAuthorityKind(), ShouldEqual, auth.NoAuth)
|
| + So(AsUser.rpcAuthorityKind(), ShouldEqual, auth.AsUser)
|
| + So(AsService.rpcAuthorityKind(), ShouldEqual, auth.AsSelf)
|
| + So(func() { Authority(-1).rpcAuthorityKind() }, ShouldPanic)
|
| + })
|
| +}
|
|
|