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

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: cosmetic fixes 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
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..b95f80f1189d4e04ad20643fa687bc23c277406d 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, exclude=None):
jbudorick 2014/12/02 15:31:24 nit: "exclude" -> "ignore"
"""Watch all public methods of the target identified by a self.call.
Args:
call: a self.call instance indetifying an object
+ exclude: a list of public methods to exclude from watching
"""
target = self.call_target(call)
+ if exclude is None:
+ exclude = []
self.watchCalls(getattr(call, method)
for method in dir(target.__class__)
- if not method.startswith('_'))
+ if not method.startswith('_') and not method in exclude)
def clearWatched(self):
"""Clear the set of watched calls."""

Powered by Google App Engine
This is Rietveld 408576698