summaryrefslogtreecommitdiff
path: root/tests/autopilot
diff options
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2015-08-19 15:54:05 +0200
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2015-08-19 15:54:05 +0200
commita86d7d7a401e1f5a282098c6fa98c2adc58a7d86 (patch)
tree5d2a4488b0d4134c8c63c4583618cbb81ad32e1c /tests/autopilot
parent88d7bc320e94689a3ebabee3dd5e60db3133354e (diff)
AP, TestSwitcher: use eventually in mouse selection tests
(bzr r3987.1.15)
Diffstat (limited to 'tests/autopilot')
-rw-r--r--tests/autopilot/unity/emulators/__init__.py2
-rw-r--r--tests/autopilot/unity/emulators/dash.py1
-rw-r--r--tests/autopilot/unity/tests/test_switcher.py8
3 files changed, 4 insertions, 7 deletions
diff --git a/tests/autopilot/unity/emulators/__init__.py b/tests/autopilot/unity/emulators/__init__.py
index 305c31592..f10173c37 100644
--- a/tests/autopilot/unity/emulators/__init__.py
+++ b/tests/autopilot/unity/emulators/__init__.py
@@ -34,7 +34,7 @@ class UnityIntrospectionObject(CustomEmulatorBase):
geostr = " geo=[{r.x}x{r.y} {r.width}x{r.height}]".format(r=self.globalRect)
obj_details.strip()
- obj_details = " "+obj_details if len(obj_details) else obj_details
+ obj_details = " "+obj_details if len(obj_details) else ""
return "<{cls} {addr} id={id}{geo}{details}>".format(cls=self.__class__.__name__,
addr=hex(id(self)),
diff --git a/tests/autopilot/unity/emulators/dash.py b/tests/autopilot/unity/emulators/dash.py
index 78dc96aed..8511d64a9 100644
--- a/tests/autopilot/unity/emulators/dash.py
+++ b/tests/autopilot/unity/emulators/dash.py
@@ -254,7 +254,6 @@ class ScopeView(UnityIntrospectionObject):
"""Get the filter bar for the current scope, or None if it doesn't have one."""
bars = self.get_children_by_type(FilterBar)
return bars[0] if bars else None
- return None
class PlacesGroup(UnityIntrospectionObject):
diff --git a/tests/autopilot/unity/tests/test_switcher.py b/tests/autopilot/unity/tests/test_switcher.py
index 981bc2c3a..d302db10f 100644
--- a/tests/autopilot/unity/tests/test_switcher.py
+++ b/tests/autopilot/unity/tests/test_switcher.py
@@ -654,7 +654,7 @@ class SwitcherDetailsMouseTests(SwitcherTestCase):
index = 0;
for cords in icon_cords:
self.mouse.move(cords[0], cords[1])
- self.assertThat(index, Equals(self.unity.switcher.selection_index))
+ self.assertThat(self.unity.switcher.selection_index, Eventually(Equals(index)))
index += 1
def test_mouse_clicks_activate_icon(self):
@@ -725,11 +725,9 @@ class SwitcherDetailsMouseTests(SwitcherTestCase):
self.unity.switcher.initiate(SwitcherMode.DETAIL)
self.addCleanup(self.unity.switcher.terminate)
- index = 0;
- for icon in self.unity.switcher.view.detail_icons:
+ for index in range(len(self.unity.switcher.view.detail_icons)):
self.unity.switcher.view.move_over_detail_icon(index)
- self.assertThat(index, Equals(self.unity.switcher.detail_selection_index))
- index += 1
+ self.assertThat(self.unity.switcher.detail_selection_index, Eventually(Equals(index)))
def test_mouse_click_will_activate_detail_icon(self):
"""