Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1087)

Unified Diff: server/config/authority_test.go

Issue 2580713002: Implement a server-side config service interface. (Closed)
Patch Set: Update MultiResolver interface, add test for MultiError. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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)
+ })
+}

Powered by Google App Engine
This is Rietveld 408576698