| OLD | NEW |
| (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 testing_utils import testing |
| 7 |
| 8 import config |
| 9 import swarming |
| 10 |
| 11 |
| 12 class SwarmbucketApiTest(testing.EndpointsTestCase): |
| 13 api_service_cls = swarming.SwarmbucketApi |
| 14 |
| 15 def test_get_builders(self): |
| 16 auth.bootstrap_group('all', [auth.Anonymous]) |
| 17 config.Bucket( |
| 18 id='master.tryserver.chromium', |
| 19 project_id='chromium', |
| 20 revision='deadbeef', |
| 21 config_content=""" |
| 22 name: "master.tryserver.chromium" |
| 23 acls { |
| 24 role: READER |
| 25 group: "all" |
| 26 } |
| 27 swarming { |
| 28 builders { |
| 29 name: "Windows" |
| 30 category: "Chromium" |
| 31 } |
| 32 builders { |
| 33 name: "Linux" |
| 34 category: "Chromium" |
| 35 } |
| 36 } |
| 37 """, |
| 38 ).put() |
| 39 |
| 40 config.Bucket( |
| 41 id='master.tryserver.v8', |
| 42 project_id='v8', |
| 43 revision='deadbeef', |
| 44 config_content=""" |
| 45 name: "master.tryserver.v8" |
| 46 acls { |
| 47 role: READER |
| 48 group: "all" |
| 49 } |
| 50 """, |
| 51 ).put() |
| 52 |
| 53 config.Bucket( |
| 54 id='secret', |
| 55 project_id='secret', |
| 56 revision='deadbeef', |
| 57 config_content='name: "secret"', |
| 58 ).put() |
| 59 |
| 60 resp = self.call_api('get_builders').json_body |
| 61 self.assertEqual(resp, { |
| 62 'buckets': [ |
| 63 { |
| 64 'name': 'master.tryserver.chromium', |
| 65 'builders': [ |
| 66 {'name': 'Windows', 'category': 'Chromium'}, |
| 67 {'name': 'Linux', 'category': 'Chromium'}, |
| 68 ] |
| 69 } |
| 70 ] |
| 71 }) |
| OLD | NEW |