on xenial help sign in
Use the base class from the toolkit in autopilot tests.
commit020b1359e515d88aee6544ffa8f482872cae5b80 authorLeo Arias <leo.arias@canonical.com> dateTue 28 Apr 2015, 09:20 (11 years ago) parent8c98a7a
10 files changed+27−33
tests/autopilot/unity8/fixture_setup.py+2−2 tests/autopilot/unity8/indicators/__init__.py+2−4 tests/autopilot/unity8/process_helpers.py+2−1 tests/autopilot/unity8/shell/emulators/__init__.py−6 tests/autopilot/unity8/shell/emulators/dash.py+6−6 tests/autopilot/unity8/shell/emulators/greeter.py+2−4 tests/autopilot/unity8/shell/emulators/launcher.py+3−2 tests/autopilot/unity8/shell/emulators/main_window.py+2−2 tests/autopilot/unity8/shell/tests/__init__.py+3−2 tests/autopilot/unity8/shell/tests/test_upstart.py+5−4
tests/autopilot/unity8/fixture_setup.py+2−2
@@ -21,13 +21,13 @@ import fixtures
2121import subprocess
2222import logging
2323
24+import ubuntuuitoolkit
2425from autopilot import introspection
2526
2627from unity8 import (
2728 get_binary_path,
2829 process_helpers
2930)
30−from unity8.shell import emulators
3131
3232logger = logging.getLogger(__name__)
3333
@@ -65,7 +65,7 @@ class LaunchDashApp(fixtures.Fixture):
6565 pid = process_helpers.start_job('unity8-dash', *all_args)
6666 return introspection.get_proxy_object_for_existing_process(
6767 pid=pid,
68− emulator_base=emulators.UnityEmulatorBase,
68+ emulator_base=ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase
6969 )
7070
7171 def stop_application(self):
tests/autopilot/unity8/indicators/__init__.py+2−4
@@ -18,10 +18,8 @@
1818import ubuntuuitoolkit
1919from autopilot import introspection
2020
21−from unity8.shell import emulators
2221
23−
24−class IndicatorPage(emulators.UnityEmulatorBase):
22+class IndicatorPage(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase):
2523
2624 """Autopilot helper for the IndicatorPage component."""
2725
@@ -166,7 +164,7 @@ class TestIndicatorPage(IndicatorPage):
166164 return self.select_single(objectName='indicator.action.slider')
167165
168166
169−class Slider(emulators.UnityEmulatorBase):
167+class Slider(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase):
170168
171169 """Autopilot helper for the Slider component."""
172170
tests/autopilot/unity8/process_helpers.py+2−1
@@ -21,6 +21,7 @@ import logging
2121import subprocess
2222import dbus
2323
24+import ubuntuuitoolkit
2425from autopilot.exceptions import ProcessSearchError
2526from autopilot.introspection import get_proxy_object_for_existing_process
2627
@@ -271,5 +272,5 @@ def _get_unity_pid():
271272def _get_unity_proxy_object(pid):
272273 return get_proxy_object_for_existing_process(
273274 pid=pid,
274− emulator_base=emulators.UnityEmulatorBase,
275+ emulator_base=ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase
275276 )
tests/autopilot/unity8/shell/emulators/__init__.py−6
@@ -17,12 +17,6 @@
1717# along with this program. If not, see <http://www.gnu.org/licenses/>.
1818#
1919
20−import ubuntuuitoolkit
21−
22−
23−class UnityEmulatorBase(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase):
24− """A base class for all unity emulators."""
25−
2620
2721class UnityEmulatorException(Exception):
2822 """Exception raised when there is an error with the Unity emulators."""
tests/autopilot/unity8/shell/emulators/dash.py+6−6
@@ -18,13 +18,13 @@
1818#
1919
2020import logging
21−import ubuntuuitoolkit
22−
23−from unity8.shell import emulators
2421
22+import ubuntuuitoolkit
2523from autopilot import logging as autopilot_logging
2624from autopilot.introspection import dbus
2725
26+from unity8.shell import emulators
27+
2828
2929logger = logging.getLogger(__name__)
3030
@@ -40,7 +40,7 @@ class DashApp():
4040 self.dash = self.main_view.select_single(Dash)
4141
4242
43−class Dash(emulators.UnityEmulatorBase):
43+class Dash(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase):
4444 """An emulator that understands the Dash."""
4545
4646 def __init__(self, *args):
@@ -188,7 +188,7 @@ class ListViewWithPageHeader(ubuntuuitoolkit.QQuickFlickable):
188188 pass
189189
190190
191−class GenericScopeView(emulators.UnityEmulatorBase):
191+class GenericScopeView(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase):
192192 """Autopilot emulator for generic scopes."""
193193
194194 @autopilot_logging.log_action(logger.info)
@@ -255,5 +255,5 @@ class GenericScopeView(emulators.UnityEmulatorBase):
255255 return result
256256
257257
258−class Preview(emulators.UnityEmulatorBase):
258+class Preview(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase):
259259 """Autopilot custom proxy object for generic previews."""
tests/autopilot/unity8/shell/emulators/greeter.py+2−4
@@ -1,7 +1,7 @@
11# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
22#
33# Unity Autopilot Test Suite
4−# Copyright (C) 2012, 2013, 2014 Canonical
4+# Copyright (C) 2012, 2013, 2014, 2015 Canonical
55#
66# This program is free software: you can redistribute it and/or modify
77# it under the terms of the GNU General Public License as published by
@@ -18,12 +18,10 @@
1818#
1919
2020import ubuntuuitoolkit
21−
2221from autopilot.utilities import sleep
23−from unity8.shell.emulators import UnityEmulatorBase
2422
2523
26−class Greeter(UnityEmulatorBase):
24+class Greeter(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase):
2725 """An emulator that understands the greeter screen."""
2826
2927 def wait_swiped_away(self):
tests/autopilot/unity8/shell/emulators/launcher.py+3−2
@@ -1,7 +1,7 @@
11# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
22#
33# Unity Autopilot Test Suite
4−# Copyright (C) 2012, 2013, 2014 Canonical
4+# Copyright (C) 2012, 2013, 2014, 2015 Canonical
55#
66# This program is free software: you can redistribute it and/or modify
77# it under the terms of the GNU General Public License as published by
@@ -20,6 +20,7 @@
2020import logging
2121
2222import autopilot.logging
23+import ubuntuuitoolkit
2324
2425from unity8.shell import emulators
2526
@@ -27,7 +28,7 @@ from unity8.shell import emulators
2728logger = logging.getLogger(__name__)
2829
2930
30−class Launcher(emulators.UnityEmulatorBase):
31+class Launcher(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase):
3132
3233 """An emulator that understands the Launcher."""
3334
tests/autopilot/unity8/shell/emulators/main_window.py+2−2
@@ -19,17 +19,17 @@
1919
2020import logging
2121
22+import ubuntuuitoolkit
2223from autopilot import logging as autopilot_logging
2324from autopilot import input
2425
25−from unity8.shell import emulators
2626from unity8.shell.emulators.greeter import Greeter
2727from unity8.shell.emulators.launcher import Launcher
2828
2929logger = logging.getLogger(__name__)
3030
3131
32−class QQuickView(emulators.UnityEmulatorBase):
32+class QQuickView(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase):
3333 """An emulator class that makes it easy to interact with the shell"""
3434
3535 def get_greeter(self):
tests/autopilot/unity8/shell/tests/__init__.py+3−2
@@ -35,6 +35,8 @@ import os.path
3535import subprocess
3636import sys
3737from testtools.matchers import Equals
38+
39+import ubuntuuitoolkit
3840from ubuntuuitoolkit import (
3941 fixture_setup as toolkit_fixtures,
4042 ubuntu_scenarios
@@ -51,7 +53,6 @@ from unity8 import (
5153 fixture_setup,
5254 process_helpers
5355)
54−from unity8.shell import emulators
5556from unity8.shell.emulators import (
5657 dash as dash_helpers,
5758 main_window as main_window_emulator,
@@ -369,7 +370,7 @@ class UnityTestCase(AutopilotTestCase):
369370 pid = process_helpers.get_job_pid('unity8-dash')
370371 dash_proxy = introspection.get_proxy_object_for_existing_process(
371372 pid=pid,
372− emulator_base=emulators.UnityEmulatorBase,
373+ emulator_base=ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase
373374 )
374375 dash_app = dash_helpers.DashApp(dash_proxy)
375376 return dash_app.dash
tests/autopilot/unity8/shell/tests/test_upstart.py+5−4
@@ -1,7 +1,7 @@
11# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
22#
33# Unity Autopilot Test Suite
4−# Copyright (C) 2013, 2014 Canonical
4+# Copyright (C) 2013, 2014, 2015 Canonical
55#
66# This program is free software: you can redistribute it and/or modify
77# it under the terms of the GNU General Public License as published by
@@ -26,13 +26,13 @@ import subprocess
2626import time
2727
2828import fixtures
29−from testtools.matchers import Equals, MismatchError
29+import ubuntuuitoolkit
3030from autopilot.matchers import Eventually
3131from autopilot.introspection import get_proxy_object_for_existing_process
32+from testtools.matchers import Equals, MismatchError
3233from ubuntuuitoolkit import ubuntu_scenarios
3334
3435from unity8 import get_binary_path
35−from unity8.shell.emulators import UnityEmulatorBase
3636from unity8.shell.tests import UnityTestCase
3737
3838import logging
@@ -90,10 +90,11 @@ class UpstartIntegrationTests(UnityTestCase):
9090 self.addCleanup(ensure_stopped)
9191
9292 def _set_proxy(self):
93+ proxy_base = ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase
9394 super()._set_proxy(
9495 get_proxy_object_for_existing_process(
9596 pid=self.process.pid,
96− emulator_base=UnityEmulatorBase,))
97+ emulator_base=proxy_base))
9798
9899 def test_no_sigstop(self):
99100 self.useFixture(