@@ -21,19 +21,16 @@ from testscenarios import multiply_scenarios
2121from unity8 import (
2222 fixture_setup,
2323 indicators,
24− process_helpers
2524)
26−from unity8.shell import tests
2725from unity8.indicators import tests
2826
2927from autopilot.matchers import Eventually
3028from testtools.matchers import Equals, NotEquals
31−import time
3229
3330
3431class TestIndicatorBaseTestCase(tests.IndicatorTestCase):
3532
36− scenarios = [ tests.IndicatorTestCase.device_emulation_scenarios[0] ]
33+ scenarios = [tests.IndicatorTestCase.device_emulation_scenarios[0]]
3734
3835 def setUp(self):
3936 super(TestIndicatorBaseTestCase, self).setUp()
@@ -49,7 +46,8 @@ class TestIndicatorBaseTestCase(tests.IndicatorTestCase):
4946 self.indicator_page = self.indicator.open()
5047
5148 def launch_indicator_service(self):
52− launch_service_fixture = fixture_setup.LaunchMockIndicatorService(self.action_delay)
49+ launch_service_fixture = \
50+ fixture_setup.LaunchMockIndicatorService(self.action_delay)
5351 self.useFixture(launch_service_fixture)
5452
5553
@@ -95,6 +93,7 @@ class TestServerValueUpdate(TestIndicatorBaseTestCase):
9593 Eventually(Equals(slider.value), timeout=20)
9694 )
9795
96+
9897class TestBuffering(TestIndicatorBaseTestCase):
9998
10099 """Test that switching multiple times will buffer activations
@@ -107,11 +106,11 @@ class TestBuffering(TestIndicatorBaseTestCase):
107106
108107 switch = self.indicator_page.get_switcher()
109108 switch.change_state()
110− intermediate_value = switch.checked;
109+ intermediate_value = switch.checked
111110
112111 # will buffer change until it receives the change from server
113112 switch.change_state()
114− final_value = switch.checked;
113+ final_value = switch.checked
115114
116115 # backend will respond to first switch.
117116 switch_menu = self.indicator_page.get_switch_menu()
@@ -121,7 +120,8 @@ class TestBuffering(TestIndicatorBaseTestCase):
121120 )
122121 # The buffered activation should have gone to server now.
123122
124− # front-end should not change as a result of server update while it is buffered
123+ # front-end should not change as a result of server update
124+ # while it is buffered
125125 self.assertThat(
126126 switch.checked,
127127 Equals(final_value)
@@ -142,15 +142,15 @@ class TestBuffering(TestIndicatorBaseTestCase):
142142 def test_slider_buffers_activations(self):
143143
144144 slider = self.indicator_page.get_slider()
145− original_value = slider.value;
145+ original_value = slider.value
146146 slider.slide_left()
147147
148148 # will buffer change until it receives the change from server
149149 slider.slide_right()
150− final_value = slider.value;
150+ final_value = slider.value
151151
152− # backend will respond to first slider. Since it's a live slider it'll probably
153− # be a random value along the slide.
152+ # backend will respond to first slider. Since it's a live slider
153+ # it'll probably be a random value along the slide.
154154 slider_menu = self.indicator_page.get_slider_menu()
155155 self.assertThat(
156156 slider_menu.serverValue,
@@ -163,7 +163,8 @@ class TestBuffering(TestIndicatorBaseTestCase):
163163 NotEquals(final_value)
164164 )
165165
166− # front-end should not change as a result of server update while it is buffered
166+ # front-end should not change as a result of server update
167+ # while it is buffered
167168 self.assertThat(
168169 slider.value,
169170 Equals(final_value)
@@ -189,17 +190,18 @@ class TestClientRevertsToServerValue(TestIndicatorBaseTestCase):
189190
190191 See https://bugs.launchpad.net/ubuntu/+source/unity8/+bug/1390136 .
191192 """
192− action_delay = -1 # never action.
193+ action_delay = -1 # never action.
193194
194195 def test_switch_reverts_on_late_response(self):
195196
196197 switch = self.indicator_page.get_switcher()
197198 switch_menu = self.indicator_page.get_switch_menu()
198199
199− original_value = switch.checked;
200+ original_value = switch.checked
200201 switch.change_state()
201202
202− # switch should revert to original value after 5 seconds (30 seconds in real usage)
203+ # switch should revert to original value after 5 seconds
204+ # (30 seconds in real usage)
203205 self.assertThat(
204206 switch.checked,
205207 Eventually(Equals(original_value), timeout=20)
@@ -216,10 +218,11 @@ class TestClientRevertsToServerValue(TestIndicatorBaseTestCase):
216218 slider = self.indicator_page.get_slider()
217219 slider_menu = self.indicator_page.get_slider_menu()
218220
219− original_value = slider.value;
221+ original_value = slider.value
220222 slider.slide_left()
221223
222− # slider should revert to original value after 5 seconds (30 seconds in real usage)
224+ # slider should revert to original value after 5 seconds
225+ # (30 seconds in real usage)
223226 self.assertThat(
224227 slider.value,
225228 Eventually(Equals(original_value), timeout=20)