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

Unified Diff: tests/presubmit_unittest.py

Issue 119284: Use more sensible behavior in presubmit checks. (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_canned_checks.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 1b020260b9a78b31ab9ca15c69d3d83350019e09..fa7dd7e340336112e4f96befa51c843df64cab2b 100755
--- a/tests/presubmit_unittest.py
+++ b/tests/presubmit_unittest.py
@@ -925,7 +925,7 @@ class CannedChecksUnittest(PresubmitTestsBase):
def testCannedCheckChangeHasNoTabs(self):
self.TestContent(presubmit_canned_checks.CheckChangeHasNoTabs,
'blah blah', 'blah\tblah',
- presubmit.OutputApi.PresubmitError)
+ presubmit.OutputApi.PresubmitPromptWarning)
def testCannedCheckLongLines(self):
check = lambda x,y: presubmit_canned_checks.CheckLongLines(x, y, 10)
@@ -934,6 +934,7 @@ class CannedChecksUnittest(PresubmitTestsBase):
def testCannedCheckTreeIsOpenOpen(self):
input_api = self.MockInputApi()
+ input_api.is_committing = True
connection = self.mox.CreateMockAnything()
input_api.urllib2.urlopen('url_to_open').AndReturn(connection)
connection.read().AndReturn('1')
@@ -945,6 +946,7 @@ class CannedChecksUnittest(PresubmitTestsBase):
def testCannedCheckTreeIsOpenClosed(self):
input_api = self.MockInputApi()
+ input_api.is_committing = True
connection = self.mox.CreateMockAnything()
input_api.urllib2.urlopen('url_to_closed').AndReturn(connection)
connection.read().AndReturn('0')
@@ -954,7 +956,7 @@ class CannedChecksUnittest(PresubmitTestsBase):
input_api, presubmit.OutputApi, url='url_to_closed', closed='0')
self.assertEquals(len(results), 1)
self.assertEquals(results[0].__class__,
- presubmit.OutputApi.PresubmitError)
+ presubmit.OutputApi.PresubmitPromptWarning)
def testRunPythonUnitTestsNoTest(self):
input_api = self.MockInputApi()
« no previous file with comments | « presubmit_canned_checks.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698