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

Unified Diff: tests/presubmit_unittest.py

Issue 74163002: Allow PRESUBMIT.py files to have old and new-style trybot specifications (as long as each file is c… (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Address maruel nits. Created 7 years 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 | « presubmit_support.py ('k') | trychange.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/presubmit_unittest.py
diff --git a/tests/presubmit_unittest.py b/tests/presubmit_unittest.py
index 23b0dfc9a052b95887f3cc06b6fd10be632e02b6..7d5838053970fc236cf44df4cc929100f7a15725 100755
--- a/tests/presubmit_unittest.py
+++ b/tests/presubmit_unittest.py
@@ -923,7 +923,11 @@ def CheckChangeOnCommit(input_api, output_api):
starts_with_space_result = [' starts_with_space']
not_list_result1 = "'foo'"
not_list_result2 = "('a', 'tuple')"
- for result in starts_with_space_result, not_list_result1, not_list_result2:
+ mixed_old_and_new = ['bot', ('bot2', set(['test']))]
+ not_set = [('bot2', ['test'])]
+ for result in (
+ starts_with_space_result, not_list_result1, not_list_result2,
+ mixed_old_and_new, not_set):
self.assertRaises(presubmit.PresubmitFailure,
executer.ExecPresubmitScript,
self.presubmit_tryslave % result, '', '', change)
@@ -932,7 +936,9 @@ def CheckChangeOnCommit(input_api, output_api):
expected_result = ['1', '2', '3']
empty_result = []
space_in_name_result = ['foo bar', '1\t2 3']
- for result in expected_result, empty_result, space_in_name_result:
+ new_style = [('bot', set(['cool', 'tests']))]
+ for result in (
+ expected_result, empty_result, space_in_name_result, new_style):
self.assertEqual(
result,
executer.ExecPresubmitScript(
« no previous file with comments | « presubmit_support.py ('k') | trychange.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698