diff options
| author | Thomi Richards <thomi.richards@canonical.com> | 2012-04-18 13:45:31 +1200 |
|---|---|---|
| committer | Thomi Richards <thomi.richards@canonical.com> | 2012-04-18 13:45:31 +1200 |
| commit | 3e43e90c22bbef18dbb29a44a7f6290960429484 (patch) | |
| tree | ac8939b456a9b9a1911fde3cb4bfe5c8b311e02a /tests | |
| parent | 560eb04562ed07fd99ffe4b049fdadd94c5a4da4 (diff) | |
| parent | ec4632c3ac82de2303f6cc6e08068d7892fec3b2 (diff) | |
Merged home-lens-tests-to-wait_for-feature into hud-tests-to-wait_for-feature.
(bzr r2220.7.6)
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/autopilot/autopilot/matchers/__init__.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/autopilot/autopilot/matchers/__init__.py b/tests/autopilot/autopilot/matchers/__init__.py index 7f946139d..f0ac66fbd 100644 --- a/tests/autopilot/autopilot/matchers/__init__.py +++ b/tests/autopilot/autopilot/matchers/__init__.py @@ -17,15 +17,15 @@ class Eventually(Matcher): def __init__(self, matcher): super(Eventually, self).__init__() match_fun = getattr(matcher, 'match', None) - if not match_fun: + if match_fun is None or not callable(match_fun): raise TypeError("Eventually must be called with a testtools matcher argument.") self.matcher = matcher def match(self, value): wait_fun = getattr(value, 'wait_for', None) - if wait_fun is None: + if wait_fun is None or not callable(wait_fun): raise TypeError("Eventually can only be used against autopilot attributes that have a wait_for funtion.") - value.wait_for(self.matcher) + wait_fun(self.matcher) def __str__(self): return "Eventually " + str(self.matcher) |
