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

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

Issue 2158953002: swarmbucket: add $project template parameter (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Created 4 years, 5 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/test/acl_test.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
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 import logging 5 import logging
6 6
7 from components import config as config_component 7 from components import config as config_component
8 from components.config import validation_context 8 from components.config import validation_context
9 from testing_utils import testing 9 from testing_utils import testing
10 import mock 10 import mock
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 ''') 65 ''')
66 66
67 67
68 class ConfigTest(testing.AppengineTestCase): 68 class ConfigTest(testing.AppengineTestCase):
69 def test_get_bucket_async(self): 69 def test_get_bucket_async(self):
70 config.Bucket( 70 config.Bucket(
71 id='master.tryserver.chromium.linux', 71 id='master.tryserver.chromium.linux',
72 project_id='chromium', 72 project_id='chromium',
73 revision='deadbeef', 73 revision='deadbeef',
74 config_content=MASTER_TRYSERVER_CHROMIUM_LINUX_CONFIG_TEXT).put() 74 config_content=MASTER_TRYSERVER_CHROMIUM_LINUX_CONFIG_TEXT).put()
75 cfg = config.get_bucket_async( 75 project, cfg = config.get_bucket_async(
76 'master.tryserver.chromium.linux').get_result() 76 'master.tryserver.chromium.linux').get_result()
77 self.assertEqual(project, 'chromium')
77 self.assertEqual( 78 self.assertEqual(
78 cfg, 79 cfg,
79 project_config_pb2.Bucket( 80 project_config_pb2.Bucket(
80 name='master.tryserver.chromium.linux', 81 name='master.tryserver.chromium.linux',
81 acls=[ 82 acls=[
82 project_config_pb2.Acl( 83 project_config_pb2.Acl(
83 role=project_config_pb2.Acl.READER, group='all'), 84 role=project_config_pb2.Acl.READER, group='all'),
84 project_config_pb2.Acl( 85 project_config_pb2.Acl(
85 role=project_config_pb2.Acl.SCHEDULER, group='tryjob-access'), 86 role=project_config_pb2.Acl.SCHEDULER, group='tryjob-access'),
86 ]), 87 ]),
87 ) 88 )
88 89
89 self.assertIsNone(config.get_bucket_async('non.existing').get_result()) 90 self.assertIsNone(config.get_bucket_async('non.existing').get_result()[0])
90 91
91 def test_get_buckets_async(self): 92 def test_get_buckets_async(self):
92 config.Bucket( 93 config.Bucket(
93 id='master.tryserver.chromium.linux', 94 id='master.tryserver.chromium.linux',
94 project_id='chromium', 95 project_id='chromium',
95 revision='deadbeef', 96 revision='deadbeef',
96 config_content=MASTER_TRYSERVER_CHROMIUM_LINUX_CONFIG_TEXT).put() 97 config_content=MASTER_TRYSERVER_CHROMIUM_LINUX_CONFIG_TEXT).put()
97 config.Bucket( 98 config.Bucket(
98 id='master.tryserver.chromium.win', 99 id='master.tryserver.chromium.win',
99 project_id='chromium', 100 project_id='chromium',
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 445
445 url = config.get_buildbucket_cfg_url('chromium') 446 url = config.get_buildbucket_cfg_url('chromium')
446 self.assertEqual( 447 self.assertEqual(
447 url, 448 url,
448 ('https://chromium.googlesource.com/chromium/src/+/' 449 ('https://chromium.googlesource.com/chromium/src/+/'
449 'infra/config/testbed-test.cfg')) 450 'infra/config/testbed-test.cfg'))
450 451
451 452
452 def errmsg(text): 453 def errmsg(text):
453 return validation_context.Message(severity=logging.ERROR, text=text) 454 return validation_context.Message(severity=logging.ERROR, text=text)
OLDNEW
« no previous file with comments | « appengine/cr-buildbucket/test/acl_test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698