aboutsummaryrefslogtreecommitdiffstats
path: root/dashboard/app/app_test.go
diff options
context:
space:
mode:
authorGreg Steuck <gnezdo@google.com>2021-06-15 11:37:27 -0700
committerDmitry Vyukov <dvyukov@google.com>2021-06-16 15:21:18 +0200
commitaba2b2fb3544d9e42991237c13d8cada421deda5 (patch)
tree46adf0ee465695d8d31535f4690737e3b9ae541b /dashboard/app/app_test.go
parentc06f97ad4b8a38e6396ff90f6084063f2303ad43 (diff)
dashboard/app: document the values in maps and rename local vars
The previous names confused a couple of unrelated concepts.
Diffstat (limited to 'dashboard/app/app_test.go')
-rw-r--r--dashboard/app/app_test.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/dashboard/app/app_test.go b/dashboard/app/app_test.go
index 98bd185a4..489732118 100644
--- a/dashboard/app/app_test.go
+++ b/dashboard/app/app_test.go
@@ -56,7 +56,7 @@ var testConfig = &GlobalConfig{
Key: "test1keytest1keytest1key",
FixBisectionAutoClose: true,
Clients: map[string]string{
- client1: key1,
+ client1: password1,
},
Repos: []KernelRepo{
{
@@ -105,7 +105,7 @@ var testConfig = &GlobalConfig{
AccessLevel: AccessAdmin,
Key: "test2keytest2keytest2key",
Clients: map[string]string{
- client2: key2,
+ client2: password2,
},
Repos: []KernelRepo{
{
@@ -262,8 +262,8 @@ var testConfig = &GlobalConfig{
const (
client1 = "client1"
client2 = "client2"
- key1 = "client1keyclient1keyclient1key"
- key2 = "client2keyclient2keyclient2key"
+ password1 = "client1keyclient1keyclient1key"
+ password2 = "client2keyclient2keyclient2key"
clientAdmin = "client-admin"
keyAdmin = "clientadminkeyclientadminkey"
clientUser = "client-user"
@@ -355,8 +355,8 @@ func TestApp(t *testing.T) {
c.expectOK(c.GET("/test1"))
- apiClient1 := c.makeClient(client1, key1, false)
- apiClient2 := c.makeClient(client2, key2, false)
+ apiClient1 := c.makeClient(client1, password1, false)
+ apiClient2 := c.makeClient(client2, password2, false)
c.expectFail("unknown api method", apiClient1.Query("unsupported_method", nil, nil))
c.client.LogError("name", "msg %s", "arg")
@@ -367,8 +367,8 @@ func TestApp(t *testing.T) {
// Some bad combinations of client/key.
c.expectFail("unauthorized", c.makeClient(client1, "", false).Query("upload_build", build, nil))
- c.expectFail("unauthorized", c.makeClient("unknown", key1, false).Query("upload_build", build, nil))
- c.expectFail("unauthorized", c.makeClient(client1, key2, false).Query("upload_build", build, nil))
+ c.expectFail("unauthorized", c.makeClient("unknown", password1, false).Query("upload_build", build, nil))
+ c.expectFail("unauthorized", c.makeClient(client1, password2, false).Query("upload_build", build, nil))
crash1 := testCrash(build, 1)
c.client.ReportCrash(crash1)