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

Unified Diff: tests/presubmit_unittest.py

Issue 113294: Add presubmit checks to look for BUG= and TEST= tags in change list descripti... (Closed) Base URL: svn://chrome-svn/chrome/trunk/tools/depot_tools/
Patch Set: '' Created 11 years, 7 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
===================================================================
--- tests/presubmit_unittest.py (revision 15890)
+++ tests/presubmit_unittest.py (working copy)
@@ -583,14 +583,41 @@
def testMembersChanged(self):
members = [
- 'CheckChangeHasNoTabs', 'CheckChangeHasQaField',
- 'CheckChangeHasTestedField', 'CheckDoNotSubmit',
+ 'CheckChangeHasBugField', 'CheckChangeHasNoTabs',
+ 'CheckChangeHasQaField', 'CheckChangeHasTestedField',
+ 'CheckChangeHasTestField', 'CheckDoNotSubmit',
'CheckDoNotSubmitInDescription', 'CheckDoNotSubmitInFiles',
'CheckLongLines', 'CheckTreeIsOpen',
]
# If this test fails, you should add the relevant test.
self.compareMembers(presubmit_canned_checks, members)
+ def testCannedCheckChangeHasBugField(self):
+ change = self.MakeBasicChange('foo',
+ 'Foo\nBUG=1234')
+ api = presubmit.InputApi(change, 'PRESUBMIT.py')
+ self.failIf(presubmit_canned_checks.CheckChangeHasBugField(
+ api, presubmit.OutputApi))
+
+ change = self.MakeBasicChange('foo',
+ 'Foo\nNEVERTESTED=did some stuff')
+ api = presubmit.InputApi(change, 'PRESUBMIT.py')
+ self.failUnless(presubmit_canned_checks.CheckChangeHasBugField(
+ api, presubmit.OutputApi))
+
+ def testCannedCheckChangeHasTestField(self):
+ change = self.MakeBasicChange('foo',
+ 'Foo\nTEST=did some stuff')
+ api = presubmit.InputApi(change, 'PRESUBMIT.py')
+ self.failIf(presubmit_canned_checks.CheckChangeHasTestField(
+ api, presubmit.OutputApi))
+
+ change = self.MakeBasicChange('foo',
+ 'Foo\nNOTEST=did some stuff')
+ api = presubmit.InputApi(change, 'PRESUBMIT.py')
+ self.failUnless(presubmit_canned_checks.CheckChangeHasTestField(
+ api, presubmit.OutputApi))
+
def testCannedCheckChangeHasTestedField(self):
change = self.MakeBasicChange('foo',
'Foo\nTESTED=did some stuff')
« 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