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

Unified Diff: tests/presubmit_unittest.py

Issue 12314044: return a list of uncovered files, not uncovered dirs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: fix formatting Created 7 years, 10 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 | « tests/owners_unittest.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 7e7c170e29d869d8c6aa518885e9aa4b8c0b848d..0014c703da5d76623f7aa17643bb31e7c9a45d97 100755
--- a/tests/presubmit_unittest.py
+++ b/tests/presubmit_unittest.py
@@ -2219,14 +2219,14 @@ class CannedChecksUnittest(PresubmitTestsBase):
def AssertOwnersWorks(self, tbr=False, issue='1', approvers=None,
reviewers=None, is_committing=True, rietveld_response=None,
- uncovered_dirs=None, expected_output=''):
+ uncovered_files=None, expected_output=''):
if approvers is None:
approvers = set()
if reviewers is None:
reviewers = set()
reviewers = reviewers.union(approvers)
- if uncovered_dirs is None:
- uncovered_dirs = set()
+ if uncovered_files is None:
+ uncovered_files = set()
change = self.mox.CreateMock(presubmit.Change)
change.issue = issue
@@ -2263,9 +2263,9 @@ class CannedChecksUnittest(PresubmitTestsBase):
rietveld_response)
people.add(owner_email)
- fake_db.directories_not_covered_by(set(['foo/xyz.cc']),
- people).AndReturn(uncovered_dirs)
- if not is_committing and uncovered_dirs:
+ fake_db.files_not_covered_by(set(['foo/xyz.cc']),
+ people).AndReturn(uncovered_files)
+ if not is_committing and uncovered_files:
fake_db.reviewers_for(set(['foo/xyz.cc'])).AndReturn(owner_email)
self.mox.ReplayAll()
@@ -2352,18 +2352,16 @@ class CannedChecksUnittest(PresubmitTestsBase):
def testCannedCheckOwners_NoIssue(self):
self.AssertOwnersWorks(issue=None,
- uncovered_dirs=set(['foo']),
+ uncovered_files=set(['foo']),
expected_output="OWNERS check failed: this change has no Rietveld "
"issue number, so we can't check it for approvals.\n")
self.AssertOwnersWorks(issue=None,
is_committing=False,
- uncovered_dirs=set(['foo']),
- expected_output='Missing OWNER reviewers for files in these '
- 'directories:\n'
+ uncovered_files=set(['foo']),
+ expected_output='Missing OWNER reviewers for these files:\n'
' foo\n'
'Until the issue is uploaded, this list will include '
- 'directories for which you \n'
- 'are an OWNER.\n')
+ 'files for which you are an OWNER.\n')
def testCannedCheckOwners_NoLGTM(self):
self.AssertOwnersWorks(expected_output='Missing LGTM from someone '
@@ -2384,22 +2382,20 @@ class CannedChecksUnittest(PresubmitTestsBase):
self.AssertOwnersWorks(tbr=True, is_committing=False, expected_output='')
def testCannedCheckOwners_WithoutOwnerLGTM(self):
- self.AssertOwnersWorks(uncovered_dirs=set(['foo']),
- expected_output='Missing LGTM from an OWNER for files in these '
- 'directories:\n'
+ self.AssertOwnersWorks(uncovered_files=set(['foo']),
+ expected_output='Missing LGTM from an OWNER for these files:\n'
' foo\n')
- self.AssertOwnersWorks(uncovered_dirs=set(['foo']),
- is_committing=False,
- expected_output='Missing OWNER reviewers for files in these '
- 'directories:\n'
+ self.AssertOwnersWorks(uncovered_files=set(['foo']),
+ is_committing=False,
+ expected_output='Missing OWNER reviewers for these files:\n'
' foo\n')
def testCannedCheckOwners_WithLGTMs(self):
self.AssertOwnersWorks(approvers=set(['ben@example.com']),
- uncovered_dirs=set())
+ uncovered_files=set())
self.AssertOwnersWorks(approvers=set(['ben@example.com']),
is_committing=False,
- uncovered_dirs=set())
+ uncovered_files=set())
def testCannedRunUnitTests(self):
change = presubmit.Change(
« no previous file with comments | « tests/owners_unittest.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698