From 14612a0481175a28b79300c677b3e6a9f6350da6 Mon Sep 17 00:00:00 2001 From: Francis Ginther Date: Tue, 20 Nov 2012 10:59:22 -0600 Subject: Fix test_switcher tests that can wrap around to the first index (bzr r2915.1.1) --- tests/autopilot/unity/tests/test_switcher.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'tests') 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""" -- cgit v1.2.3