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

Unified Diff: PRESUBMIT_test_mocks.py

Issue 933253002: Reland https://codereview.chromium.org/929043002/: Add a presubmit check that warns about declaring… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert chrome/browser/chromeos/login/users/mock_user_manager.cc Created 5 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 | « PRESUBMIT_test.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: PRESUBMIT_test_mocks.py
diff --git a/PRESUBMIT_test_mocks.py b/PRESUBMIT_test_mocks.py
index 7d286b9daa13260d70db6b1b43b624067c656381..5caa156593415fca998701940c2f03add77e52cf 100644
--- a/PRESUBMIT_test_mocks.py
+++ b/PRESUBMIT_test_mocks.py
@@ -29,10 +29,15 @@ class MockInputApi(object):
def AffectedFiles(self, file_filter=None):
return self.files
+ def AffectedSourceFiles(self, file_filter=None):
+ return self.files
+
def PresubmitLocalPath(self):
return os.path.dirname(__file__)
def ReadFile(self, filename, mode='rU'):
+ if hasattr(filename, 'AbsoluteLocalPath'):
+ filename = filename.AbsoluteLocalPath()
for file_ in self.files:
if file_.LocalPath() == filename:
return '\n'.join(file_.NewContents())
@@ -96,6 +101,11 @@ class MockFile(object):
return self._local_path
+class MockAffectedFile(MockFile):
+ def AbsoluteLocalPath(self):
+ return self._local_path
+
+
class MockChange(object):
"""Mock class for Change class.
« no previous file with comments | « PRESUBMIT_test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698