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

Unified Diff: tests/presubmit_unittest.py

Issue 125095: Add partial presubmit support to git checkout. (Closed)
Patch Set: . Created 11 years, 6 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 0de435a9c026852ab8e3d6dd4dd8a950994a39a8..004469d416ed32936f53ff887deed380b6e21679 100755
--- a/tests/presubmit_unittest.py
+++ b/tests/presubmit_unittest.py
@@ -63,7 +63,8 @@ class PresubmitUnittest(PresubmitTestsBase):
def testMembersChanged(self):
self.mox.ReplayAll()
members = [
- 'AffectedFile', 'Change', 'DoPresubmitChecks', 'InputApi',
+ 'AffectedFile', 'Change', 'DoPresubmitChecks', 'GitChange',
+ 'GitAffectedFile', 'InputApi',
'ListRelevantPresubmitFiles', 'Main', 'NotImplementedException',
'OutputApi', 'ParseFiles', 'PresubmitExecuter', 'ScanSubDirs',
'SvnAffectedFile', 'SvnChange',
@@ -462,6 +463,24 @@ def CheckChangeOnCommit(input_api, output_api):
'** Presubmit Messages **\n'
'http://tracker.com/42\n\n'))
+ def testMain(self):
+ self.mox.StubOutWithMock(presubmit, 'DoPresubmitChecks')
+ self.mox.StubOutWithMock(presubmit, 'ParseFiles')
+ presubmit.os.path.isdir(presubmit.os.path.join(self.fake_root_dir, '.git')
+ ).AndReturn(False)
Nicolas Sylvain 2009/06/15 17:04:14 weird alignment. first time i see something like t
+ presubmit.os.path.isdir(presubmit.os.path.join(self.fake_root_dir, '.svn')
+ ).AndReturn(False)
+ #presubmit.ParseFiles([], None).AndReturn([])
Nicolas Sylvain 2009/06/15 17:04:14 commented out?
+ presubmit.DoPresubmitChecks(mox.IgnoreArg(), False, False,
+ mox.IgnoreArg(),
+ mox.IgnoreArg(),
+ None, False).AndReturn(False)
+ self.mox.ReplayAll()
+
+ self.assertEquals(True,
+ presubmit.Main(['presubmit', '--root',
+ self.fake_root_dir]))
+
class InputApiUnittest(PresubmitTestsBase):
"""Tests presubmit.InputApi."""
« 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