on xenial help sign in
Minor pep8 fixes.
ec8ce9cChristopher Lee
tests/autopilot/unity8/shell/emulators/dash.py+5−2
@@ -1,11 +1,15 @@
1from unity8.shell.emulators import Unity8EmulatorBase
1from unity8.shell.emulators import Unity8EmulatorBase
2
2
3+
3class Dash(Unity8EmulatorBase):
4class Dash(Unity8EmulatorBase):
4
5
5 """An emulator that understands the Dash."""
6 """An emulator that understands the Dash."""
6
7
7 def get_home_applications_grid(self):
8 def get_home_applications_grid(self):
9+ return self.select_single(
10+ "ApplicationsFilterGrid",
8− return self.select_single("ApplicationsFilterGrid", objectName="dashHomeApplicationsGrid")
11+ objectName="dashHomeApplicationsGrid"
12+ )
9
13
10 def get_application_icon(self, text):
14 def get_application_icon(self, text):
11 """Returns a 'Tile' icon that has the text 'text' from the application
15 """Returns a 'Tile' icon that has the text 'text' from the application
@@ -18,4 +22,3 @@ class Dash(Unity8EmulatorBase):
18 app_grid = self.get_home_applications_grid()
22 app_grid = self.get_home_applications_grid()
19 resp_grid = app_grid.select_single('ResponsiveGridView')
23 resp_grid = app_grid.select_single('ResponsiveGridView')
20 return resp_grid.select_single('Tile', text=text)
24 return resp_grid.select_single('Tile', text=text)
21−
tests/autopilot/unity8/shell/emulators/hud.py+1
@@ -2,6 +2,7 @@ from unity8 import get_grid_size
2from unity8.shell.emulators import Unity8EmulatorBase
2from unity8.shell.emulators import Unity8EmulatorBase
3from autopilot.input import Touch
3from autopilot.input import Touch
4
4
5+
5class Hud(Unity8EmulatorBase):
6class Hud(Unity8EmulatorBase):
6
7
7 """An emulator that understands the Hud."""
8 """An emulator that understands the Hud."""
tests/autopilot/unity8/shell/emulators/launcher.py+1
@@ -1,6 +1,7 @@
1from unity8.shell.emulators import Unity8EmulatorBase
1from unity8.shell.emulators import Unity8EmulatorBase
2from autopilot.input import Touch
2from autopilot.input import Touch
3
3
4+
4class Launcher(Unity8EmulatorBase):
5class Launcher(Unity8EmulatorBase):
5
6
6 """An emulator that understands the Launcher."""
7 """An emulator that understands the Launcher."""
tests/autopilot/unity8/shell/tests/test_hud.py+4−7
@@ -12,11 +12,8 @@ from collections import namedtuple
12from unity8.shell import with_lightdm_mock
12from unity8.shell import with_lightdm_mock
13from unity8.shell.tests import Unity8TestCase, _get_device_emulation_scenarios
13from unity8.shell.tests import Unity8TestCase, _get_device_emulation_scenarios
14
14
15−from autopilot.display import Display
16−from autopilot.input import Touch
17−from testtools.matchers import Equals, MismatchError
15+from testtools.matchers import Equals
18from autopilot.matchers import Eventually
16from autopilot.matchers import Eventually
19−from autopilot.platform import model
20
17
21
18
22SwipeCoords = namedtuple('SwipeCoords', 'start_x end_x start_y end_y')
19SwipeCoords = namedtuple('SwipeCoords', 'start_x end_x start_y end_y')
@@ -35,7 +32,6 @@ class TestHud(Unity8TestCase):
35 self.main_window.get_greeter().unlock()
32 self.main_window.get_greeter().unlock()
36 window = self.main_window.get_qml_view()
33 window = self.main_window.get_qml_view()
37 hud_show_button = self.main_window.get_hud_show_button()
34 hud_show_button = self.main_window.get_hud_show_button()
38− hud = self.main_window.get_hud()
39
35
40 self._launch_test_app_from_app_screen()
36 self._launch_test_app_from_app_screen()
41
37
@@ -173,7 +169,8 @@ class TestHud(Unity8TestCase):
173
169
174 # Ensure application is open
170 # Ensure application is open
175 bottombar = self.main_window.get_bottombar()
171 bottombar = self.main_window.get_bottombar()
176− self.assertThat(bottombar.applicationIsOnForeground, Eventually(Equals(True)))
172+ self.assertThat(bottombar.applicationIsOnForeground,
173+ Eventually(Equals(True)))
177
174
178 # Because some tests are manually manipulating the finger, we want to
175 # Because some tests are manually manipulating the finger, we want to
179 # cleanup if the test fails, but we don't want to fail with an exception if
176 # cleanup if the test fails, but we don't want to fail with an exception if
@@ -191,7 +188,7 @@ class TestHud(Unity8TestCase):
191 """
188 """
192 start_x = int(main_view.x + (main_view.width / 2))
189 start_x = int(main_view.x + (main_view.width / 2))
193 end_x = start_x
190 end_x = start_x
194− start_y = main_view.y + (main_view.height -3)
191+ start_y = main_view.y + (main_view.height - 3)
195 end_y = int(hud_show_button.y + (hud_show_button.height/2))
192 end_y = int(hud_show_button.y + (hud_show_button.height/2))
196
193
197 return SwipeCoords(start_x, end_x, start_y, end_y)
194 return SwipeCoords(start_x, end_x, start_y, end_y)