on xenial help sign in
Minor pep8 fixes.
commitec8ce9ca0341196ae19e86959c0d0ba901b429ce authorChristopher Lee <chris.lee@canonical.com> dateWed 17 Jul 2013, 19:25 (13 years ago) parent6d154f1
4 files changed+11−9
tests/autopilot/unity8/shell/emulators/dash.py+5−2 tests/autopilot/unity8/shell/emulators/hud.py+1 tests/autopilot/unity8/shell/emulators/launcher.py+1 tests/autopilot/unity8/shell/tests/test_hud.py+4−7
tests/autopilot/unity8/shell/emulators/dash.py+5−2
@@ -1,11 +1,15 @@
11from unity8.shell.emulators import Unity8EmulatorBase
22
3+
34class Dash(Unity8EmulatorBase):
45
56 """An emulator that understands the Dash."""
67
78 def get_home_applications_grid(self):
8− return self.select_single("ApplicationsFilterGrid", objectName="dashHomeApplicationsGrid")
9+ return self.select_single(
10+ "ApplicationsFilterGrid",
11+ objectName="dashHomeApplicationsGrid"
12+ )
913
1014 def get_application_icon(self, text):
1115 """Returns a 'Tile' icon that has the text 'text' from the application
@@ -18,4 +22,3 @@ class Dash(Unity8EmulatorBase):
1822 app_grid = self.get_home_applications_grid()
1923 resp_grid = app_grid.select_single('ResponsiveGridView')
2024 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
22from unity8.shell.emulators import Unity8EmulatorBase
33from autopilot.input import Touch
44
5+
56class Hud(Unity8EmulatorBase):
67
78 """An emulator that understands the Hud."""
tests/autopilot/unity8/shell/emulators/launcher.py+1
@@ -1,6 +1,7 @@
11from unity8.shell.emulators import Unity8EmulatorBase
22from autopilot.input import Touch
33
4+
45class Launcher(Unity8EmulatorBase):
56
67 """An emulator that understands the Launcher."""
tests/autopilot/unity8/shell/tests/test_hud.py+4−7
@@ -12,11 +12,8 @@ from collections import namedtuple
1212from unity8.shell import with_lightdm_mock
1313from unity8.shell.tests import Unity8TestCase, _get_device_emulation_scenarios
1414
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
1816from autopilot.matchers import Eventually
19−from autopilot.platform import model
2017
2118
2219SwipeCoords = namedtuple('SwipeCoords', 'start_x end_x start_y end_y')
@@ -35,7 +32,6 @@ class TestHud(Unity8TestCase):
3532 self.main_window.get_greeter().unlock()
3633 window = self.main_window.get_qml_view()
3734 hud_show_button = self.main_window.get_hud_show_button()
38− hud = self.main_window.get_hud()
3935
4036 self._launch_test_app_from_app_screen()
4137
@@ -173,7 +169,8 @@ class TestHud(Unity8TestCase):
173169
174170 # Ensure application is open
175171 bottombar = self.main_window.get_bottombar()
176− self.assertThat(bottombar.applicationIsOnForeground, Eventually(Equals(True)))
172+ self.assertThat(bottombar.applicationIsOnForeground,
173+ Eventually(Equals(True)))
177174
178175 # Because some tests are manually manipulating the finger, we want to
179176 # cleanup if the test fails, but we don't want to fail with an exception if
@@ -191,7 +188,7 @@ class TestHud(Unity8TestCase):
191188 """
192189 start_x = int(main_view.x + (main_view.width / 2))
193190 end_x = start_x
194− start_y = main_view.y + (main_view.height -3)
191+ start_y = main_view.y + (main_view.height - 3)
195192 end_y = int(hud_show_button.y + (hud_show_button.height/2))
196193
197194 return SwipeCoords(start_x, end_x, start_y, end_y)