diff options
Diffstat (limited to 'chromium/PRESUBMIT_test_mocks.py')
-rw-r--r-- | chromium/PRESUBMIT_test_mocks.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/chromium/PRESUBMIT_test_mocks.py b/chromium/PRESUBMIT_test_mocks.py index 8e15d8cf53d..373b52c6d3c 100644 --- a/chromium/PRESUBMIT_test_mocks.py +++ b/chromium/PRESUBMIT_test_mocks.py @@ -26,7 +26,7 @@ class MockInputApi(object): self.is_committing = False self.change = MockChange([]) - def AffectedFiles(self, file_filter=None): + def AffectedFiles(self, file_filter=None, include_deletes=False): return self.files def AffectedSourceFiles(self, file_filter=None): @@ -92,10 +92,14 @@ class MockFile(object): MockInputApi for presubmit unittests. """ - def __init__(self, local_path, new_contents): + def __init__(self, local_path, new_contents, action='A'): self._local_path = local_path self._new_contents = new_contents self._changed_contents = [(i + 1, l) for i, l in enumerate(new_contents)] + self._action = action + + def Action(self): + return self._action def ChangedContents(self): return self._changed_contents @@ -106,6 +110,9 @@ class MockFile(object): def LocalPath(self): return self._local_path + def AbsoluteLocalPath(self): + return self._local_path + def rfind(self, p): """os.path.basename is called on MockFile so we need an rfind method.""" return self._local_path.rfind(p) |