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

Unified Diff: lucictx/types_test.go

Issue 2951553002: Extend LUCI_CONTEXT["local_auth"] protocol to understand accounts. (Closed)
Patch Set: few more tests Created 3 years, 6 months 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
« no previous file with comments | « lucictx/local_auth.go ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lucictx/types_test.go
diff --git a/lucictx/types_test.go b/lucictx/types_test.go
index 5508f035d283fbb433dbe4b430f8a1422854f754..281c3d58ac45febe42f2846193ed94679fd454eb 100644
--- a/lucictx/types_test.go
+++ b/lucictx/types_test.go
@@ -21,12 +21,22 @@ func TestPredefinedTypes(t *testing.T) {
Convey("local_auth", func() {
So(GetLocalAuth(c), ShouldBeNil)
- c = SetLocalAuth(c, &LocalAuth{100, []byte("foo")})
+ localAuth := LocalAuth{
+ RPCPort: 100,
+ Secret: []byte("foo"),
+ Accounts: []LocalAuthAccount{
+ {"test"},
+ },
+ DefaultAccountID: "test",
+ }
+
+ c = SetLocalAuth(c, &localAuth)
rawJSON := json.RawMessage{}
Get(c, "local_auth", &rawJSON)
- So(string(rawJSON), ShouldEqual, `{"rpc_port":100,"secret":"Zm9v"}`)
+ So(string(rawJSON), ShouldEqual, `{"rpc_port":100,"secret":"Zm9v",`+
+ `"accounts":[{"id":"test"}],"default_account_id":"test"}`)
- So(GetLocalAuth(c), ShouldResemble, &LocalAuth{100, []byte("foo")})
+ So(GetLocalAuth(c), ShouldResemble, &localAuth)
})
Convey("swarming", func() {
« no previous file with comments | « lucictx/local_auth.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698