on xenial help sign in
Removed the tests for some code paths and preconditions for the life cycle test.
commit2a8bad3cc2b6762f5c4e4ad0d0ef0d57629a61e2 authorLeo Arias <leo.arias@canonical.com> dateWed 9 Jul 2014, 11:28 (12 years ago) parent8660d30
3 files changed−71
tests/autopilot/unity8/shell/emulators/launcher.py−9 tests/autopilot/unity8/shell/emulators/main_window.py−8 tests/autopilot/unity8/shell/tests/test_emulators.py−54
tests/autopilot/unity8/shell/emulators/launcher.py−9
@@ -56,15 +56,6 @@ class Launcher(emulators.UnityEmulatorBase):
5656
5757 self.pointing_device.drag(start_x, start_y, stop_x, stop_y)
5858
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−
6859 @autopilot.logging.log_action(logger.debug)
6960 def click_dash_icon(self):
7061 if self.shown:
tests/autopilot/unity8/shell/emulators/main_window.py−8
@@ -152,11 +152,3 @@ class QQuickView(emulators.UnityEmulatorBase):
152152
153153 def _get_launcher(self):
154154 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):
5555 self.assertEqual(text_field.text, 'Test')
5656 self.assertEqual(text_field.state, 'idle')
5757
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−
7658
7759class DashBaseTestCase(tests.UnityTestCase):
7860
@@ -219,39 +201,3 @@ class DashAppsEmulatorTestCase(DashBaseTestCase):
219201 return filtergrid.collapsedRowCount * filtergrid.columns
220202 else:
221203 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))