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

Unified Diff: tests/presubmit_unittest.py

Issue 8203002: Add assert to make sure the files argument type is valid. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 9 years, 2 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') | no next file » | 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..0c066d17dbb6ed9a00788119679c0f8c0b288105 100755
--- a/tests/presubmit_unittest.py
+++ b/tests/presubmit_unittest.py
@@ -351,6 +351,20 @@ class PresubmitUnittest(PresubmitTestsBase):
self.assertEquals(rhs_lines[13][1], 49)
self.assertEquals(rhs_lines[13][2], 'this is line number 48.1')
+ def testInvalidChange(self):
+ try:
+ presubmit.SvnChange(
+ 'mychange',
+ 'description',
+ self.fake_root_dir,
+ ['foo/blat.cc', 'bar'],
+ 0,
+ 0,
+ None)
+ self.fail()
+ except AssertionError:
+ pass
+
def testExecPresubmitScript(self):
description_lines = ('Hello there',
'this is a change',
@@ -770,7 +784,7 @@ def CheckChangeOnCommit(input_api, output_api):
self.mox.StubOutWithMock(presubmit, 'ParseFiles')
presubmit.scm.determine_scm(self.fake_root_dir).AndReturn(None)
presubmit.ParseFiles(['random_file.txt'], None
- ).AndReturn(['random_file.txt'])
+ ).AndReturn([('M', 'random_file.txt')])
output = self.mox.CreateMock(presubmit.PresubmitOutput)
output.should_continue().AndReturn(False)
« no previous file with comments | « presubmit_support.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698