on xenial help sign in
Fix flake8 errors, remove imports using emulator and rename emulator tests to helper tests.
commitf4e4fcc78fcf7c7df35ab1b698ead45475d6b40f authorRichard Huddie <richard.huddie@canonical.com> dateWed 24 Jun 2015, 12:14 (11 years ago) parent6dea74c
3 files changed+12−20
tests/autopilot/unity8/application_lifecycle/tests/test_application_lifecycle.py+4−2 tests/autopilot/unity8/fixture_setup.py+5−15 tests/autopilot/unity8/shell/tests/test_helpers.py+3−3
tests/autopilot/unity8/application_lifecycle/tests/test_application_lifecycle.py+4−2
@@ -92,14 +92,16 @@ class ApplicationLifecycleTests(tests.ApplicationLifeCycleTestCase):
9292 process_helpers.lock_unity()
9393
9494 # FIXME - this is because the device greeter uses a password.
95− # Need to be able to selectively enable mocks so that we can use the fake greeter.
95+ # Need to be able to selectively enable mocks so that we can use the
96+ # fake greeter.
9697 def unlock_thread_worker(greeter):
9798 greeter.wait_swiped_away()
9899 process_helpers.unlock_unity()
99100 greeter.created.wait_for(False)
100101
101102 greeter = self.main_window.get_greeter()
102− unlock_thread = threading.Thread(target=unlock_thread_worker, args=(greeter,))
103+ unlock_thread = threading.Thread(
104+ target=unlock_thread_worker, args=(greeter,))
103105 unlock_thread.start()
104106 application_name = self.launch_fake_app()
105107 unlock_thread.join(10)
tests/autopilot/unity8/fixture_setup.py+5−15
@@ -31,21 +31,14 @@ from ubuntuuitoolkit import fixture_setup
3131
3232from unity8 import (
3333 get_binary_path,
34+ get_mocks_library_path,
35+ get_default_extra_mock_libraries,
36+ get_data_dirs,
3437 sensors,
38+ shell,
3539 process_helpers
3640)
3741
38−from unity8.shell import emulators
39−
40−from unity8.shell.emulators import (
41− main_window as main_window_emulator
42−)
43−
44−from unity8 import (
45− get_mocks_library_path,
46− get_default_extra_mock_libraries,
47− get_data_dirs
48−)
4942
5043logger = logging.getLogger(__name__)
5144
@@ -140,8 +133,7 @@ class LaunchUnityWithFakeSensors(fixtures.Fixture):
140133 args = [binary_arg] + env_args
141134 self.unity_proxy = process_helpers.restart_unity_with_testability(
142135 *args)
143− self.main_win = self.unity_proxy.select_single(
144− main_window_emulator.QQuickView)
136+ self.main_win = self.unity_proxy.select_single(shell.QQuickView)
145137
146138 def _create_sensors(self):
147139 # Wait for unity to start running.
@@ -159,8 +151,6 @@ class LaunchUnityWithFakeSensors(fixtures.Fixture):
159151 fifo.write('create light 0 10 1\n')
160152 fifo.write('create proximity\n')
161153
162−logger = logging.getLogger(__name__)
163−
164154
165155class RestartUnityWithTestability(fixtures.Fixture):
166156
tests/autopilot/unity8/shell/tests/test_helpers.py+3−3
@@ -44,7 +44,7 @@ class MainWindowTestCase(tests.UnityTestCase):
4444 process_helpers.unlock_unity()
4545
4646
47−class DashEmulatorTestCase(tests.DashBaseTestCase):
47+class DashHelperTestCase(tests.DashBaseTestCase):
4848
4949 def test_search(self):
5050 self.dash.enter_search_query('Test')
@@ -106,7 +106,7 @@ class DashEmulatorTestCase(tests.DashBaseTestCase):
106106 self.assertIsInstance(scope, dash_helpers.GenericScopeView)
107107
108108
109−class GenericScopeViewEmulatorTestCase(tests.DashBaseTestCase):
109+class GenericScopeViewHelperTestCase(tests.DashBaseTestCase):
110110
111111 def setUp(self):
112112 # Set up the fake scopes before launching unity.
@@ -126,7 +126,7 @@ class GenericScopeViewEmulatorTestCase(tests.DashBaseTestCase):
126126 self.assertTrue(preview.isCurrent)
127127
128128
129−class DashAppsEmulatorTestCase(tests.DashBaseTestCase):
129+class DashAppsHelperTestCase(tests.DashBaseTestCase):
130130
131131 available_applications = [
132132 'Title.2.0', 'Title.2.1', 'Title.2.2', 'Title.2.3', 'Title.2.4',