OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package hierarchy | 5 package hierarchy |
6 | 6 |
7 import ( | 7 import ( |
8 "fmt" | 8 "fmt" |
9 "testing" | 9 "testing" |
10 | 10 |
(...skipping 26 matching lines...) Expand all Loading... |
37 | 37 |
38 Convey(`When requesting Project-level list`, func() { | 38 Convey(`When requesting Project-level list`, func() { |
39 r.Project = "" | 39 r.Project = "" |
40 | 40 |
41 // Only add project namespaces for some of our registere
d projects. | 41 // Only add project namespaces for some of our registere
d projects. |
42 // | 42 // |
43 // We add a project namespace to our datastore by creati
ng a single entity | 43 // We add a project namespace to our datastore by creati
ng a single entity |
44 // within that namespace. | 44 // within that namespace. |
45 addProjectNamespace := func(proj luciConfig.ProjectName)
{ | 45 addProjectNamespace := func(proj luciConfig.ProjectName)
{ |
46 c := c | 46 c := c |
47 » » » » if err := coordinator.WithProjectNamespaceNoAuth
(&c, proj); err != nil { | 47 » » » » if err := coordinator.WithProjectNamespace(&c, p
roj, coordinator.NamespaceAccessNoAuth); err != nil { |
48 panic(err) | 48 panic(err) |
49 } | 49 } |
50 | 50 |
51 entity := ds.PropertyMap{ | 51 entity := ds.PropertyMap{ |
52 "$id": []ds.Property{ds.MkProperty("wo
of")}, | 52 "$id": []ds.Property{ds.MkProperty("wo
of")}, |
53 "$kind": []ds.Property{ds.MkProperty("Do
g")}, | 53 "$kind": []ds.Property{ds.MkProperty("Do
g")}, |
54 } | 54 } |
55 if err := ds.Get(c).Put(entity); err != nil { | 55 if err := ds.Get(c).Put(entity); err != nil { |
56 panic(err) | 56 panic(err) |
57 } | 57 } |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 func norm(c []*ListComponent) []string { | 294 func norm(c []*ListComponent) []string { |
295 result := make([]string, len(c)) | 295 result := make([]string, len(c)) |
296 for i, e := range c { | 296 for i, e := range c { |
297 result[i] = e.Name | 297 result[i] = e.Name |
298 if e.Stream { | 298 if e.Stream { |
299 result[i] += "$" | 299 result[i] += "$" |
300 } | 300 } |
301 } | 301 } |
302 return result | 302 return result |
303 } | 303 } |
OLD | NEW |