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 2532583002: Presubmit: Warn about useless forward declarations (Closed)
Patch Set: Changed version Created 4 years, 1 month 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 772f405725be0f575c193ad0ecac46d93d973d06..37b0159276df974fcb9cef44f39fdd4473913273 100644
--- a/PRESUBMIT_test_mocks.py
+++ b/PRESUBMIT_test_mocks.py
@@ -99,6 +99,10 @@ class MockFile(object):
self._new_contents = new_contents
self._changed_contents = [(i + 1, l) for i, l in enumerate(new_contents)]
self._action = action
+ self._scm_diff = "--- /dev/null\n+++ %s\n@@ -0,0 +1,%d @@\n" % (local_path,
+ len(new_contents))
+ for l in new_contents:
+ self._scm_diff += "+%s\n" % l
def Action(self):
return self._action
@@ -115,6 +119,9 @@ class MockFile(object):
def AbsoluteLocalPath(self):
return self._local_path
+ def GenerateScmDiff(self):
+ return self._scm_diff;
+
def rfind(self, p):
"""os.path.basename is called on MockFile so we need an rfind method."""
return self._local_path.rfind(p)
« 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