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