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

Unified Diff: tests/presubmit_unittest.py

Issue 9664015: Adds saner behavior for git try -t foo to not fail in a inexplicable way. Enforces that each builde… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: improve comment Created 8 years, 9 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 | « 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 84585e993235f0dc4a92007f4137469066b1a8b3..6c85ac95f4cd26c4fa8364581bd909d4b66dba0c 100755
--- a/tests/presubmit_unittest.py
+++ b/tests/presubmit_unittest.py
@@ -792,6 +792,25 @@ def CheckChangeOnCommit(input_api, output_api):
self.fake_root_dir, None, None,
False, output))
+ def testGetTrySlavesExecuter_ok(self):
+ script_text = (
+ 'def GetPreferredTrySlaves():\n'
+ ' return ["foo", "bar"]\n')
+ results = presubmit.GetTrySlavesExecuter.ExecPresubmitScript(
+ script_text, 'path', 'project', None)
+ self.assertEquals(['foo', 'bar'], results)
+
+ def testGetTrySlavesExecuter_comma(self):
+ script_text = (
+ 'def GetPreferredTrySlaves():\n'
+ ' return ["foo,bar"]\n')
+ try:
+ presubmit.GetTrySlavesExecuter.ExecPresubmitScript(
+ script_text, 'path', 'project', None)
+ self.fail()
+ except presubmit.PresubmitFailure:
+ pass
+
def testMainUnversioned(self):
# OptParser calls presubmit.os.path.exists and is a pain when mocked.
self.UnMock(presubmit.os.path, 'exists')
« 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