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

Unified Diff: tests/presubmit_unittest.py

Issue 8036046: Revert r102783 "Support for |change| argument to |GetPreferredTrySlaves()|." (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 9 years, 3 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') | tests/trychange_unittest.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 055e8b6fc370444889d35527ee257777325d151f..466189e9c6409e95dae052aba1ab8e22f9af3031 100755
--- a/tests/presubmit_unittest.py
+++ b/tests/presubmit_unittest.py
@@ -153,7 +153,7 @@ class PresubmitUnittest(PresubmitTestsBase):
'OutputApi', 'ParseFiles', 'PresubmitFailure',
'PresubmitExecuter', 'PresubmitOutput', 'ScanSubDirs',
'SvnAffectedFile', 'SvnChange', 'cPickle', 'cStringIO',
- 'fix_encoding', 'fnmatch', 'gclient_utils', 'glob', 'inspect', 'json',
+ 'fix_encoding', 'fnmatch', 'gclient_utils', 'glob', 'json',
'load_files',
'logging', 'marshal', 'normpath', 'optparse', 'os', 'owners', 'pickle',
'presubmit_canned_checks', 'random', 're', 'rietveld', 'scm',
@@ -669,18 +669,11 @@ def CheckChangeOnCommit(input_api, output_api):
def testGetTrySlavesExecuter(self):
self.mox.ReplayAll()
- change = presubmit.Change(
- 'foo',
- 'Blah Blah\n\nSTORY=http://tracker.com/42\nBUG=boo\n',
- self.fake_root_dir,
- None,
- 0,
- 0,
- None)
+
executer = presubmit.GetTrySlavesExecuter()
- self.assertEqual([], executer.ExecPresubmitScript('', '', '', change))
- self.assertEqual([],
- executer.ExecPresubmitScript('def foo():\n return\n', '', '', change))
+ self.assertEqual([], executer.ExecPresubmitScript('', '', ''))
+ self.assertEqual(
+ [], executer.ExecPresubmitScript('def foo():\n return\n', '', ''))
# bad results
starts_with_space_result = [' starts_with_space']
@@ -689,7 +682,7 @@ def CheckChangeOnCommit(input_api, output_api):
for result in starts_with_space_result, not_list_result1, not_list_result2:
self.assertRaises(presubmit.PresubmitFailure,
executer.ExecPresubmitScript,
- self.presubmit_tryslave % result, '', '', change)
+ self.presubmit_tryslave % result, '', '')
# good results
expected_result = ['1', '2', '3']
@@ -699,31 +692,20 @@ def CheckChangeOnCommit(input_api, output_api):
self.assertEqual(
result,
executer.ExecPresubmitScript(
- self.presubmit_tryslave % result, '', '', change))
+ self.presubmit_tryslave % result, '', ''))
def testGetTrySlavesExecuterWithProject(self):
self.mox.ReplayAll()
- change = presubmit.Change(
- 'foo',
- 'Blah Blah\n\nSTORY=http://tracker.com/42\nBUG=boo\n',
- self.fake_root_dir,
- None,
- 0,
- 0,
- None)
-
executer = presubmit.GetTrySlavesExecuter()
expected_result1 = ['1', '2']
expected_result2 = ['a', 'b', 'c']
script = self.presubmit_tryslave_project % (
repr('foo'), repr(expected_result1), repr(expected_result2))
self.assertEqual(
- expected_result1, executer.ExecPresubmitScript(script, '', 'foo',
- change))
+ expected_result1, executer.ExecPresubmitScript(script, '', 'foo'))
self.assertEqual(
- expected_result2, executer.ExecPresubmitScript(script, '', 'bar',
- change))
+ expected_result2, executer.ExecPresubmitScript(script, '', 'bar'))
def testDoGetTrySlaves(self):
join = presubmit.os.path.join
@@ -748,18 +730,13 @@ def CheckChangeOnCommit(input_api, output_api):
self.presubmit_tryslave % '["linux"]')
self.mox.ReplayAll()
- change = presubmit.Change(
- 'mychange', '', self.fake_root_dir, [], 0, 0, None)
-
output = StringIO.StringIO()
self.assertEqual(['win'],
- presubmit.DoGetTrySlaves(change, [filename],
- self.fake_root_dir,
+ presubmit.DoGetTrySlaves([filename], self.fake_root_dir,
None, None, False, output))
output = StringIO.StringIO()
self.assertEqual(['win', 'linux'],
- presubmit.DoGetTrySlaves(change,
- [filename, filename_linux],
+ presubmit.DoGetTrySlaves([filename, filename_linux],
self.fake_root_dir, None, None,
False, output))
« no previous file with comments | « presubmit_support.py ('k') | tests/trychange_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698