on xenial help sign in
Removed the tests for some code paths and preconditions for the life cycle test.
2a8bad3Leo Arias
tests/autopilot/unity8/shell/emulators/launcher.py−9
@@ -56,15 +56,6 @@ class Launcher(emulators.UnityEmulatorBase):
56
56
57 self.pointing_device.drag(start_x, start_y, stop_x, stop_y)
57 self.pointing_device.drag(start_x, start_y, stop_x, stop_y)
58
58
59− @autopilot.logging.log_action(logger.debug)
60− def hide(self):
61− """Hide the launcher swiping it to the left."""
62− if self.shown:
63− self._swipe_launcher('left')
64− self.shown.wait_for(False)
65− else:
66− logger.debug('The launcher is already closed.')
67−
68 @autopilot.logging.log_action(logger.debug)
59 @autopilot.logging.log_action(logger.debug)
69 def click_dash_icon(self):
60 def click_dash_icon(self):
70 if self.shown:
61 if self.shown:
tests/autopilot/unity8/shell/emulators/main_window.py−8
@@ -152,11 +152,3 @@ class QQuickView(emulators.UnityEmulatorBase):
152
152
153 def _get_launcher(self):
153 def _get_launcher(self):
154 return self.select_single(Launcher)
154 return self.select_single(Launcher)
155−
156− @autopilot_logging.log_action(logger.info)
157− def close_launcher(self):
158− launcher = self._get_launcher()
159− launcher.hide()
160−
161− def is_launcher_open(self):
162− return self._get_launcher().shown
tests/autopilot/unity8/shell/tests/test_emulators.py−54
@@ -55,24 +55,6 @@ class MainWindowTestCase(tests.UnityTestCase):
55 self.assertEqual(text_field.text, 'Test')
55 self.assertEqual(text_field.text, 'Test')
56 self.assertEqual(text_field.state, 'idle')
56 self.assertEqual(text_field.state, 'idle')
57
57
58− def test_open_launcher_must_return_launcher_custom_proxy_object(self):
59− launcher = self.main_window.open_launcher()
60− self.assertIsInstance(launcher, launcher_emulator.Launcher)
61−
62− def test_open_launcher_must_open_it(self):
63− # Make sure that the launcher is closed.
64− self.main_window.close_launcher()
65− self.main_window.open_launcher()
66−
67− self.assertTrue(self.main_window.is_launcher_open())
68−
69− def test_close_launcher_must_close_it(self):
70− # Make sure that the launcher is open.
71− self.main_window.open_launcher()
72− self.main_window.close_launcher()
73−
74− self.assertFalse(self.main_window.is_launcher_open())
75−
76
58
77class DashBaseTestCase(tests.UnityTestCase):
59class DashBaseTestCase(tests.UnityTestCase):
78
60
@@ -219,39 +201,3 @@ class DashAppsEmulatorTestCase(DashBaseTestCase):
219 return filtergrid.collapsedRowCount * filtergrid.columns
201 return filtergrid.collapsedRowCount * filtergrid.columns
220 else:
202 else:
221 return filtergrid.uncollapsedRowCount * filtergrid.columns
203 return filtergrid.uncollapsedRowCount * filtergrid.columns
222−
223−
224−class LauncherTestCase(tests.UnityTestCase):
225−
226− scenarios = tests._get_device_emulation_scenarios()
227−
228− def setUp(self):
229− super(LauncherTestCase, self).setUp()
230− unity_proxy = self.launch_unity()
231− process_helpers.unlock_unity(unity_proxy)
232−
233− def test_show_launcher_with_launcher_open_must_do_nothing(self):
234− launcher = self.main_window.open_launcher()
235− with mock.patch.object(launcher.pointing_device, 'drag') as mock_drag:
236− launcher.show()
237−
238− self.assertFalse(mock_drag.called)
239−
240− def test_hide_launcher_with_launcher_closed_must_do_nothing(self):
241− launcher = self.main_window.open_launcher()
242− launcher.hide()
243− with mock.patch.object(launcher.pointing_device, 'drag') as mock_drag:
244− launcher.hide()
245−
246− self.assertFalse(mock_drag.called)
247−
248− def test_click_dash_icon_with_launcher_closed_must_raise_exception(self):
249− launcher = self.main_window.open_launcher()
250− launcher.hide()
251−
252− exception = self.assertRaises(
253− emulators.UnityEmulatorException,
254− launcher.click_dash_icon)
255−
256− self.assertEqual(
257− 'The launcher is closed.', str(exception))