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

Unified Diff: build/android/pylib/utils/mock_calls.py

Issue 762883002: Make device serial required in AdbWrapper/DeviceUtils (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: renamed: exclude -> ignore Created 6 years 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 | « build/android/pylib/instrumentation/test_runner_test.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/utils/mock_calls.py
diff --git a/build/android/pylib/utils/mock_calls.py b/build/android/pylib/utils/mock_calls.py
index b10ebc68e167bdc0e02abfebf4e4c58930296c1a..fab9f2b4ecac41ad7bdd65b7eda87b02c0e32b0b 100644
--- a/build/android/pylib/utils/mock_calls.py
+++ b/build/android/pylib/utils/mock_calls.py
@@ -122,16 +122,19 @@ class TestCase(unittest.TestCase):
"""
self._watched.update((call.name, call) for call in calls)
- def watchMethodCalls(self, call):
+ def watchMethodCalls(self, call, ignore=None):
"""Watch all public methods of the target identified by a self.call.
Args:
call: a self.call instance indetifying an object
+ ignore: a list of public methods to ignore when watching for calls
"""
target = self.call_target(call)
+ if ignore is None:
+ ignore = []
self.watchCalls(getattr(call, method)
for method in dir(target.__class__)
- if not method.startswith('_'))
+ if not method.startswith('_') and not method in ignore)
def clearWatched(self):
"""Clear the set of watched calls."""
« no previous file with comments | « build/android/pylib/instrumentation/test_runner_test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698