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

Unified Diff: tests/presubmit_unittest.py

Issue 851103004: Remove the 'author_counts_as_owner' option from CheckOwners(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 5 years, 11 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 3bb79b5c0997c9a3232f106ac9f4664789af6624..e46457e0acb1f0f63278f423a1d6f1e7eaef98ab 100755
--- a/tests/presubmit_unittest.py
+++ b/tests/presubmit_unittest.py
@@ -2603,7 +2603,7 @@ class CannedChecksUnittest(PresubmitTestsBase):
def AssertOwnersWorks(self, tbr=False, issue='1', approvers=None,
reviewers=None, is_committing=True, rietveld_response=None,
- uncovered_files=None, expected_output='', author_counts_as_owner=True,
+ uncovered_files=None, expected_output='',
manually_specified_reviewers=None):
if approvers is None:
# The set of people who lgtm'ed a change.
@@ -2654,14 +2654,9 @@ class CannedChecksUnittest(PresubmitTestsBase):
issue=int(input_api.change.issue), messages=True).AndReturn(
rietveld_response)
- if author_counts_as_owner:
- people.add(change.author_email)
- fake_db.files_not_covered_by(set(['foo/xyz.cc']),
- people).AndReturn(uncovered_files)
- else:
- people.discard(change.author_email)
- fake_db.files_not_covered_by(set(['foo/xyz.cc']),
- people).AndReturn(uncovered_files)
+ people.add(change.author_email)
+ 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']),
change.author_email).AndReturn(change.author_email)
@@ -2669,7 +2664,7 @@ class CannedChecksUnittest(PresubmitTestsBase):
self.mox.ReplayAll()
output = presubmit.PresubmitOutput()
results = presubmit_canned_checks.CheckOwners(input_api,
- presubmit.OutputApi, author_counts_as_owner=author_counts_as_owner)
+ presubmit.OutputApi)
if results:
results[0].handle(output)
self.assertEquals(output.getvalue(), expected_output)
@@ -2797,18 +2792,6 @@ class CannedChecksUnittest(PresubmitTestsBase):
is_committing=False,
expected_output='')
- def testCannedCheckOwners_AuthorCountsAsOwner(self):
- self.AssertOwnersWorks(approvers=set(['john@example.com',
- 'brett@example.com']),
- reviewers=set(['john@example.com',
- 'ben@example.com']),
- uncovered_files=set(['foo/xyz.cc', 'foo/bar.cc']),
- expected_output='Missing LGTM from an OWNER '
- 'for these files:\n'
- ' foo/bar.cc\n'
- ' foo/xyz.cc\n',
- author_counts_as_owner=False)
-
def testCannedCheckOwners_TBR(self):
self.AssertOwnersWorks(tbr=True,
expected_output='--tbr was specified, skipping OWNERS check\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