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

Unified Diff: tests/presubmit_unittest.py

Issue 118527: Add CheckChangeHasNoStrayWhitespace(). (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 0f2ec1b577dd97c7a5ebb715f83b01eec481858b..cf21017bb6068591b18fc5cbc05a06553ad7a2a7 100755
--- a/tests/presubmit_unittest.py
+++ b/tests/presubmit_unittest.py
@@ -938,6 +938,7 @@ class CannedChecksUnittest(PresubmitTestsBase):
self.mox.ReplayAll()
members = [
'CheckChangeHasBugField', 'CheckChangeHasDescription',
+ 'CheckChangeHasNoStrayWhitespace',
'CheckChangeHasOnlyOneEol', 'CheckChangeHasNoCR',
'CheckChangeHasNoCrAndHasOnlyOneEol', 'CheckChangeHasNoTabs',
'CheckChangeHasQaField', 'CheckChangeHasTestedField',
@@ -1093,6 +1094,14 @@ class CannedChecksUnittest(PresubmitTestsBase):
'DO NOTSUBMIT', 'DO NOT ' + 'SUBMIT',
presubmit.OutputApi.PresubmitError)
+ def testCheckChangeHasNoStrayWhitespace(self):
+ self.ContentTest(
+ lambda x,y,z:
+ presubmit_canned_checks.CheckChangeHasNoStrayWhitespace(x, y),
+ 'Foo', 'Foo ',
+ presubmit.OutputApi.PresubmitPromptWarning)
+
+
def testCheckChangeHasOnlyOneEol(self):
self.ReadFileTest(presubmit_canned_checks.CheckChangeHasOnlyOneEol,
"Hey!\nHo!\n", "Hey!\nHo!\n\n",
« 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