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

Side by Side Diff: appengine/cr-buildbucket/swarming/test/swarmbucket_api_test.py

Issue 2005333002: swarmbucket: add get_builders api (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: fix tests Created 4 years, 7 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 unified diff | Download patch
« no previous file with comments | « appengine/cr-buildbucket/swarming/swarmbucket_api.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright 2016 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 from components import auth
6 from components import auth_testing
7 from testing_utils import testing
8
9 import config
10 import swarming
11
12
13 class SwarmbucketApiTest(testing.EndpointsTestCase):
14 api_service_cls = swarming.SwarmbucketApi
15
16 def test_get_builders(self):
17 auth_testing.reset_local_state()
18 auth.bootstrap_group('all', [auth.Anonymous])
19 config.Bucket(
20 id='master.tryserver.chromium',
21 project_id='chromium',
22 revision='deadbeef',
23 config_content="""
24 name: "master.tryserver.chromium"
25 acls {
26 role: READER
27 group: "all"
28 }
29 swarming {
30 builders {
31 name: "Windows"
32 category: "Chromium"
33 }
34 builders {
35 name: "Linux"
36 category: "Chromium"
37 }
38 }
39 """,
40 ).put()
41
42 config.Bucket(
43 id='master.tryserver.v8',
44 project_id='v8',
45 revision='deadbeef',
46 config_content="""
47 name: "master.tryserver.v8"
48 acls {
49 role: READER
50 group: "all"
51 }
52 """,
53 ).put()
54
55 config.Bucket(
56 id='secret',
57 project_id='secret',
58 revision='deadbeef',
59 config_content='name: "secret"',
60 ).put()
61
62 resp = self.call_api('get_builders').json_body
63 self.assertEqual(resp, {
64 'buckets': [
65 {
66 'name': 'master.tryserver.chromium',
67 'builders': [
68 {'name': 'Windows', 'category': 'Chromium'},
69 {'name': 'Linux', 'category': 'Chromium'},
70 ]
71 }
72 ]
73 })
OLDNEW
« no previous file with comments | « appengine/cr-buildbucket/swarming/swarmbucket_api.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698