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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « appengine/cr-buildbucket/swarming/swarmbucket_api.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/cr-buildbucket/swarming/test/swarmbucket_api_test.py
diff --git a/appengine/cr-buildbucket/swarming/test/swarmbucket_api_test.py b/appengine/cr-buildbucket/swarming/test/swarmbucket_api_test.py
new file mode 100644
index 0000000000000000000000000000000000000000..98a15c2f89897b45408c25dbd9b5163e16d19780
--- /dev/null
+++ b/appengine/cr-buildbucket/swarming/test/swarmbucket_api_test.py
@@ -0,0 +1,73 @@
+# Copyright 2016 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+from components import auth
+from components import auth_testing
+from testing_utils import testing
+
+import config
+import swarming
+
+
+class SwarmbucketApiTest(testing.EndpointsTestCase):
+ api_service_cls = swarming.SwarmbucketApi
+
+ def test_get_builders(self):
+ auth_testing.reset_local_state()
+ auth.bootstrap_group('all', [auth.Anonymous])
+ config.Bucket(
+ id='master.tryserver.chromium',
+ project_id='chromium',
+ revision='deadbeef',
+ config_content="""
+ name: "master.tryserver.chromium"
+ acls {
+ role: READER
+ group: "all"
+ }
+ swarming {
+ builders {
+ name: "Windows"
+ category: "Chromium"
+ }
+ builders {
+ name: "Linux"
+ category: "Chromium"
+ }
+ }
+ """,
+ ).put()
+
+ config.Bucket(
+ id='master.tryserver.v8',
+ project_id='v8',
+ revision='deadbeef',
+ config_content="""
+ name: "master.tryserver.v8"
+ acls {
+ role: READER
+ group: "all"
+ }
+ """,
+ ).put()
+
+ config.Bucket(
+ id='secret',
+ project_id='secret',
+ revision='deadbeef',
+ config_content='name: "secret"',
+ ).put()
+
+ resp = self.call_api('get_builders').json_body
+ self.assertEqual(resp, {
+ 'buckets': [
+ {
+ 'name': 'master.tryserver.chromium',
+ 'builders': [
+ {'name': 'Windows', 'category': 'Chromium'},
+ {'name': 'Linux', 'category': 'Chromium'},
+ ]
+ }
+ ]
+ })
« 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