summaryrefslogtreecommitdiff
path: root/tests
diff options
authorFrancis Ginther <francis.ginther@canonical.com>2012-11-20 10:59:22 -0600
committerFrancis Ginther <francis.ginther@canonical.com>2012-11-20 10:59:22 -0600
commit14612a0481175a28b79300c677b3e6a9f6350da6 (patch)
treeb137ebcf881e6e14b154d5e3163401647e74a7fb /tests
parent330f458e4702d6a66f420221ff6ba55b3108a071 (diff)
Fix test_switcher tests that can wrap around to the first index
(bzr r2915.1.1)
Diffstat (limited to 'tests')
-rw-r--r--tests/autopilot/unity/tests/test_switcher.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/autopilot/unity/tests/test_switcher.py b/tests/autopilot/unity/tests/test_switcher.py
index 964bf3d4c..52a56512a 100644
--- a/tests/autopilot/unity/tests/test_switcher.py
+++ b/tests/autopilot/unity/tests/test_switcher.py
@@ -124,8 +124,10 @@ class SwitcherTests(SwitcherTestCase):
start = self.switcher.selection_index
self.switcher.next_icon()
+ # Allow for wrap-around to first icon in switcher
+ next_index = (start + 1) % len(self.switcher.icons)
- self.assertThat(self.switcher.selection_index, Eventually(Equals(start + 1)))
+ self.assertThat(self.switcher.selection_index, Eventually(Equals(next_index)))
def test_switcher_move_prev(self):
"""Test that pressing the previous icon binding moves to the previous icon"""
@@ -146,8 +148,10 @@ class SwitcherTests(SwitcherTestCase):
start = self.switcher.selection_index
self.switcher.next_via_mouse()
+ # Allow for wrap-around to first icon in switcher
+ next_index = (start + 1) % len(self.switcher.icons)
- self.assertThat(self.switcher.selection_index, Eventually(Equals(start + 1)))
+ self.assertThat(self.switcher.selection_index, Eventually(Equals(next_index)))
def test_switcher_scroll_prev(self):
"""Test that scrolling the mouse wheel up moves to the previous icon"""