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.""" |