presubmit_unittest: Fix pylint errors.

The recent pylint 1.3.1 and 1.4.0 upgrades have caused some new errors
to be reported for presubmit_unittest:

* presubmit_support.InputApi.AffectedFiles() expectes a parameter called
  |include_deletes|, not |include_deleted|.

* The mock AffectedFiles() implementation in
  CannedChecksUnittest.testCannedCheckChangeHasNoTabs() had its
  signature updated to match the one in presubmit_support.InputApi,
  otherwise pylint would (erroneously) consider that this mock
  implementation was used in all other AffectedFiles() invocations in
  CannedChecksUnittest and complain that some parameters were missing.
  It makes more sense to do this than disable the check and miss real
  problems in the future.

R=maruel@chromium.org, iannucci@chromium.org, pgervais@chromium.org
BUG=443232

Review URL: https://codereview.chromium.org/802403003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@293468 0039d316-1c4b-4281-b951-d872f2087c98
parent e0c89731
......@@ -2000,7 +2000,7 @@ class CannedChecksUnittest(PresubmitTestsBase):
if use_source_file:
input_api1.AffectedSourceFiles(None).AndReturn(files1)
else:
input_api1.AffectedFiles(include_deleted=False).AndReturn(files1)
input_api1.AffectedFiles(include_deletes=False).AndReturn(files1)
presubmit.scm.SVN.GetFileProperty(
presubmit.normpath('foo/bar.cc'), property_name, self.fake_root_dir
).AndReturn(value1)
......@@ -2017,7 +2017,7 @@ class CannedChecksUnittest(PresubmitTestsBase):
if use_source_file:
input_api2.AffectedSourceFiles(None).AndReturn(files2)
else:
input_api2.AffectedFiles(include_deleted=False).AndReturn(files2)
input_api2.AffectedFiles(include_deletes=False).AndReturn(files2)
presubmit.scm.SVN.GetFileProperty(
presubmit.normpath('foo/bar.cc'), property_name, self.fake_root_dir
......@@ -2175,7 +2175,7 @@ class CannedChecksUnittest(PresubmitTestsBase):
affected_files = (affected_file1, affected_file2,
affected_file3, affected_file4)
def test(file_filter, include_deletes):
def test(include_dirs=False, include_deletes=True, file_filter=None):
self.assertFalse(include_deletes)
for x in affected_files:
if file_filter(x):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment