Merge lp:~nskaggs/ubuntu-ui-toolkit/fix-aphelper-emulator-warning into lp:ubuntu-ui-toolkit/staging

Proposed by Nicholas Skaggs
Status: Merged
Approved by: Zoltan Balogh
Approved revision: 1067
Merged at revision: 1195
Proposed branch: lp:~nskaggs/ubuntu-ui-toolkit/fix-aphelper-emulator-warning
Merge into: lp:ubuntu-ui-toolkit/staging
Diff against target: 298 lines (+30/-30)
12 files modified
tests/autopilot/ubuntuuitoolkit/__init__.py (+0/-2)
tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_checkbox.py (+1/-1)
tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_common.py (+4/-4)
tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_header.py (+4/-4)
tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_mainview.py (+8/-7)
tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_optionselector.py (+1/-1)
tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_tabbar.py (+1/-1)
tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_tabs.py (+1/-1)
tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_textfield.py (+1/-1)
tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_toolbar.py (+1/-1)
tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/popups.py (+2/-2)
tests/autopilot/ubuntuuitoolkit/tests/__init__.py (+6/-5)
To merge this branch: bzr merge lp:~nskaggs/ubuntu-ui-toolkit/fix-aphelper-emulator-warning
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Leo Arias (community) Approve
Tim Peeters Pending
Review via email: mp+227093@code.launchpad.net

This proposal supersedes a proposal from 2014-07-14.

Commit message

Fix the warning for the emulators module. The warning will now only appear if you use the module directly. Bug 134169

Description of the change

Fix the warning for the emulators module by removing it from the base import.

"The ubuntuuitoolkit.emulators module is deprecated. Import the autopilot helpers from the top-level ubuntuuitoolkit module."

The warning will now only appear if you use the module directly.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Approve (continuous-integration)
Revision history for this message
Leo Arias (elopio) wrote : Posted in a previous version of this proposal

The warning is still being printed. Please notice that you need to remove the 'emulators' also from the __all__ list. And emulators is still being used on tests/__init__.py, which is imported by ubuntuuitoolkit. Probably we also need to remove tests from the ubuntuuitoolkit/__init__.py.

Sorry about the mess.

review: Needs Fixing (code review)
Revision history for this message
Tim Peeters (tpeeters) wrote : Posted in a previous version of this proposal

Please submit new MRs for merging into lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/staging. It needs to go there first before we land it in trunk.

review: Needs Resubmitting
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:1060
http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-ci/607/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/2102
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/1760
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-amd64-ci/439
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-ci/439
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-ci/439/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-i386-ci/439
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/2330
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/3242
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/3242/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/9968
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/1479
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1970
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1970/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-ci/607/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:1062
http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-ci/608/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/2111
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/1767
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-amd64-ci/440
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-ci/440
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-ci/440/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-i386-ci/440
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/2338
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/3256
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/3256/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/9980
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/1486
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1979
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1979/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-ci/608/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

Seems we found this bug in autopilot: https://bugs.launchpad.net/ubuntu-calendar-app/+bug/1328600

    self._cached_dt = datetime.fromtimestamp(self[0])
OverflowError: timestamp out of range for platform time_t

Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

Triggering rebuild which should be clean now that the bug is solved in staging.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:1062
http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-ci/648/
Executed test runs:
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/2334/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/1918
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-amd64-ci/480
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-ci/480
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-ci/480/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-i386-ci/480
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/2518/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/3545
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/3545/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/10239
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/1608
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2148
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2148/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-ci/648/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:1063
http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-ci/662/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/2464
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/1997
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-amd64-ci/494
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-ci/494
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-ci/494/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-i386-ci/494
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/2625
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/3707
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/3707/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/10382
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/1670
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2247
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2247/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-ci/662/rebuild

review: Approve (continuous-integration)
Revision history for this message
Leo Arias (elopio) wrote :

balloons, your test_import_toolkit_must_not_log_warning is wrong because after patching the log you are not trying to import the module. So the log will always be empty.
I tried to re-import ubuntuuitoolkit, but none of the tricks I have used before worked in this case. Maybe we can get a hand from thomi, barry or mfoord, unless you have a better idea than the ones I tried.

Thanks.

Revision history for this message
Leo Arias (elopio) :
review: Needs Fixing (code review)
Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

Still have to solve ubuntuuitoolkit/tests/test_import.py:28:9: F401 'ubuntuuitoolkit' imported but unused . . .

Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

Leo, I think I've fixed your concerns in a quasi sane manner.. I hope at least.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:1065
http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-ci/737/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/3138
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/2464
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-amd64-ci/569
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-ci/569
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-ci/569/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-i386-ci/569
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/3170
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/4382
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/4382/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/11121
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/2041
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2734
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2734/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-ci/737/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Leo Arias (elopio) wrote :

Thanks!

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

hmm

+ make -n coverage-xml
+ grep 'No rule to make target'
make: *** No rule to make target 'coverage-xml'. Stop.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:1066
http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-ci/786/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/3382
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/2653/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-amd64-ci/618
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-ci/618
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-ci/618/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-i386-ci/618
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/3309
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/4629
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/4629/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/11309
    FAILURE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/2145/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2930
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2930/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-ci/786/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:1066
http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-ci/799/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/3446
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/2708
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-amd64-ci/631
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-ci/631
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-ci/631/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-i386-ci/631
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/3354
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/4693
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/4693/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/11362
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/2188
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2985
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2985/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-ci/799/rebuild

review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'tests/autopilot/ubuntuuitoolkit/__init__.py'
--- tests/autopilot/ubuntuuitoolkit/__init__.py 2014-07-26 00:10:22 +0000
+++ tests/autopilot/ubuntuuitoolkit/__init__.py 2014-08-07 18:48:22 +0000
@@ -23,7 +23,6 @@
23 'check_autopilot_version',23 'check_autopilot_version',
24 'CheckBox',24 'CheckBox',
25 'environment',25 'environment',
26 'emulators',
27 'fixture_setup',26 'fixture_setup',
28 'get_keyboard',27 'get_keyboard',
29 'get_pointing_device',28 'get_pointing_device',
@@ -50,7 +49,6 @@
5049
51from ubuntuuitoolkit import (50from ubuntuuitoolkit import (
52 base,51 base,
53 emulators,
54 environment,52 environment,
55 fixture_setup,53 fixture_setup,
56 tests,54 tests,
5755
=== modified file 'tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_checkbox.py'
--- tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_checkbox.py 2014-04-16 21:13:39 +0000
+++ tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_checkbox.py 2014-08-07 18:48:22 +0000
@@ -25,7 +25,7 @@
2525
2626
27class CheckBox(_common.UbuntuUIToolkitCustomProxyObjectBase):27class CheckBox(_common.UbuntuUIToolkitCustomProxyObjectBase):
28 """CheckBox Autopilot emulator."""28 """CheckBox Autopilot custom proxy object."""
2929
30 @autopilot_logging.log_action(logger.info)30 @autopilot_logging.log_action(logger.info)
31 def check(self, timeout=10):31 def check(self, timeout=10):
3232
=== modified file 'tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_common.py'
--- tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_common.py 2014-05-29 16:18:53 +0000
+++ tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_common.py 2014-08-07 18:48:22 +0000
@@ -32,7 +32,7 @@
3232
3333
34class ToolkitException(Exception):34class ToolkitException(Exception):
35 """Exception raised when there is an error with the emulator."""35 """Exception raised when there is an error with the custom proxy object."""
3636
3737
38def get_pointing_device():38def get_pointing_device():
@@ -59,17 +59,17 @@
59 """Check that the Autopilot installed version matches the one required.59 """Check that the Autopilot installed version matches the one required.
6060
61 :raise ToolkitException: If the installed Autopilot version does't61 :raise ToolkitException: If the installed Autopilot version does't
62 match the required by the emulators.62 match the required by the custom proxy objects.
6363
64 """64 """
65 installed_version = version.LooseVersion(autopilot.version)65 installed_version = version.LooseVersion(autopilot.version)
66 if installed_version < version.LooseVersion('1.4'):66 if installed_version < version.LooseVersion('1.4'):
67 raise ToolkitException(67 raise ToolkitException(
68 'The emulators need Autopilot 1.4 or higher.')68 'The custom proxy objects require Autopilot 1.4 or higher.')
6969
7070
71class UbuntuUIToolkitCustomProxyObjectBase(dbus.CustomEmulatorBase):71class UbuntuUIToolkitCustomProxyObjectBase(dbus.CustomEmulatorBase):
72 """A base class for all the Ubuntu UI Toolkit emulators."""72 """A base class for all the Ubuntu UI Toolkit custom proxy objects."""
7373
74 def __init__(self, *args):74 def __init__(self, *args):
75 check_autopilot_version()75 check_autopilot_version()
7676
=== modified file 'tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_header.py'
--- tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_header.py 2014-07-31 05:40:01 +0000
+++ tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_header.py 2014-08-07 18:48:22 +0000
@@ -32,7 +32,7 @@
3232
3333
34class AppHeader(_common.UbuntuUIToolkitCustomProxyObjectBase):34class AppHeader(_common.UbuntuUIToolkitCustomProxyObjectBase):
35 """AppHeader Autopilot emulator."""35 """AppHeader Autopilot custom proxy object."""
3636
37 def _show_if_not_visible(self):37 def _show_if_not_visible(self):
38 if not self._is_visible():38 if not self._is_visible():
@@ -124,7 +124,7 @@
124 def switch_to_next_tab(self):124 def switch_to_next_tab(self):
125 """Open the next tab.125 """Open the next tab.
126126
127 :raise ToolkitEmulatorException: If the main view has no tabs.127 :raise ToolkitException: If the main view has no tabs.
128128
129 """129 """
130 self._show_if_not_visible()130 self._show_if_not_visible()
@@ -154,8 +154,8 @@
154 """Open a tab. This only supports the new tabs in the header154 """Open a tab. This only supports the new tabs in the header
155155
156 :parameter index: The index of the tab to open.156 :parameter index: The index of the tab to open.
157 :raise ToolkitEmulatorException: If the tab index is out of range or157 :raise ToolkitException: If the tab index is out
158 useDeprecatedToolbar is set.158 of range or useDeprecatedToolbar is set.
159159
160 """160 """
161 self._show_if_not_visible()161 self._show_if_not_visible()
162162
=== modified file 'tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_mainview.py'
--- tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_mainview.py 2014-07-29 08:43:51 +0000
+++ tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_mainview.py 2014-08-07 18:48:22 +0000
@@ -36,17 +36,17 @@
3636
3737
38class MainView(_common.UbuntuUIToolkitCustomProxyObjectBase):38class MainView(_common.UbuntuUIToolkitCustomProxyObjectBase):
39 """MainView Autopilot emulator."""39 """MainView Autopilot custom proxy object."""
4040
41 def get_header(self):41 def get_header(self):
42 """Return the AppHeader emulator of the MainView."""42 """Return the AppHeader custom proxy object of the MainView."""
43 try:43 try:
44 return self.select_single(objectName='MainView_Header')44 return self.select_single(objectName='MainView_Header')
45 except dbus.StateNotFoundError:45 except dbus.StateNotFoundError:
46 raise _common.ToolkitException('The main view has no header.')46 raise _common.ToolkitException('The main view has no header.')
4747
48 def get_toolbar(self):48 def get_toolbar(self):
49 """Return the Toolbar emulator of the MainView."""49 """Return the Toolbar custom proxy object of the MainView."""
50 return self.select_single(_toolbar.Toolbar)50 return self.select_single(_toolbar.Toolbar)
5151
52 @autopilot_logging.log_action(logger.info)52 @autopilot_logging.log_action(logger.info)
@@ -64,7 +64,7 @@
64 self.get_toolbar().close()64 self.get_toolbar().close()
6565
66 def get_tabs(self):66 def get_tabs(self):
67 """Return the Tabs emulator of the MainView.67 """Return the Tabs custom proxy object of the MainView.
6868
69 :raise ToolkitException: If the main view has no tabs.69 :raise ToolkitException: If the main view has no tabs.
7070
@@ -93,7 +93,8 @@
9393
94 :parameter index: The index of the tab to open.94 :parameter index: The index of the tab to open.
95 :return: The newly opened tab.95 :return: The newly opened tab.
96 :raise ToolkitEmulatorException: If the tab index is out of range.96 :raise ToolkitException: If the tab index
97 is out of range.
9798
98 """99 """
99 if self.useDeprecatedToolbar:100 if self.useDeprecatedToolbar:
@@ -114,7 +115,7 @@
114 'Current tab index: {0}.'.format(tabs.selectedTabIndex))115 'Current tab index: {0}.'.format(tabs.selectedTabIndex))
115 if number_of_switches >= number_of_tabs - 1:116 if number_of_switches >= number_of_tabs - 1:
116 # This prevents a loop. But if this error is ever raised, it's117 # This prevents a loop. But if this error is ever raised, it's
117 # likely there's a bug on the emulator or on the QML Tab.118 # likely there's a bug on the helper or on the QML Tab.
118 raise _common.ToolkitException(119 raise _common.ToolkitException(
119 'The tab with index {0} was not selected.'.format(index))120 'The tab with index {0} was not selected.'.format(index))
120 current_tab = self.switch_to_next_tab()121 current_tab = self.switch_to_next_tab()
@@ -164,7 +165,7 @@
164 'Tab with objectName "{0}" not found.'.format(object_name))165 'Tab with objectName "{0}" not found.'.format(object_name))
165166
166 def get_action_selection_popover(self, object_name):167 def get_action_selection_popover(self, object_name):
167 """Return an ActionSelectionPopover emulator.168 """Return an ActionSelectionPopover custom proxy object.
168169
169 :parameter object_name: The QML objectName property of the popover.170 :parameter object_name: The QML objectName property of the popover.
170171
171172
=== modified file 'tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_optionselector.py'
--- tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_optionselector.py 2014-04-17 01:35:43 +0000
+++ tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_optionselector.py 2014-08-07 18:48:22 +0000
@@ -23,7 +23,7 @@
2323
2424
25class OptionSelector(_common.UbuntuUIToolkitCustomProxyObjectBase):25class OptionSelector(_common.UbuntuUIToolkitCustomProxyObjectBase):
26 """OptionSelector Autopilot emulator"""26 """OptionSelector Autopilot custom proxy object"""
2727
28 def get_option_count(self):28 def get_option_count(self):
29 """Gets the number of items in the option selector"""29 """Gets the number of items in the option selector"""
3030
=== modified file 'tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_tabbar.py'
--- tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_tabbar.py 2014-04-16 21:13:39 +0000
+++ tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_tabbar.py 2014-08-07 18:48:22 +0000
@@ -25,7 +25,7 @@
2525
2626
27class TabBar(_common.UbuntuUIToolkitCustomProxyObjectBase):27class TabBar(_common.UbuntuUIToolkitCustomProxyObjectBase):
28 """TabBar Autopilot emulator."""28 """TabBar Autopilot custom proxy object."""
2929
30 @autopilot_logging.log_action(logger.info)30 @autopilot_logging.log_action(logger.info)
31 def switch_to_next_tab(self):31 def switch_to_next_tab(self):
3232
=== modified file 'tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_tabs.py'
--- tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_tabs.py 2014-04-16 21:13:39 +0000
+++ tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_tabs.py 2014-08-07 18:48:22 +0000
@@ -18,7 +18,7 @@
1818
1919
20class Tabs(_common.UbuntuUIToolkitCustomProxyObjectBase):20class Tabs(_common.UbuntuUIToolkitCustomProxyObjectBase):
21 """Tabs Autopilot emulator."""21 """Tabs Autopilot custom proxy object."""
2222
23 def get_current_tab(self):23 def get_current_tab(self):
24 """Return the currently selected tab."""24 """Return the currently selected tab."""
2525
=== modified file 'tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_textfield.py'
--- tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_textfield.py 2014-07-13 07:19:15 +0000
+++ tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_textfield.py 2014-08-07 18:48:22 +0000
@@ -23,7 +23,7 @@
2323
2424
25class TextField(_common.UbuntuUIToolkitCustomProxyObjectBase):25class TextField(_common.UbuntuUIToolkitCustomProxyObjectBase):
26 """TextField Autopilot emulator."""26 """TextField Autopilot custom proxy object."""
2727
28 def __init__(self, *args):28 def __init__(self, *args):
29 super(TextField, self).__init__(*args)29 super(TextField, self).__init__(*args)
3030
=== modified file 'tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_toolbar.py'
--- tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_toolbar.py 2014-04-16 21:13:39 +0000
+++ tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_toolbar.py 2014-08-07 18:48:22 +0000
@@ -26,7 +26,7 @@
2626
2727
28class Toolbar(_common.UbuntuUIToolkitCustomProxyObjectBase):28class Toolbar(_common.UbuntuUIToolkitCustomProxyObjectBase):
29 """Toolbar Autopilot emulator."""29 """Toolbar Autopilot custom proxy object."""
3030
31 @autopilot_logging.log_action(logger.info)31 @autopilot_logging.log_action(logger.info)
32 def open(self):32 def open(self):
3333
=== modified file 'tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/popups.py'
--- tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/popups.py 2014-07-31 07:18:29 +0000
+++ tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/popups.py 2014-08-07 18:48:22 +0000
@@ -66,7 +66,7 @@
6666
6767
68class ActionSelectionPopover(_common.UbuntuUIToolkitCustomProxyObjectBase):68class ActionSelectionPopover(_common.UbuntuUIToolkitCustomProxyObjectBase):
69 """ActionSelectionPopover Autopilot emulator."""69 """ActionSelectionPopover Autopilot custom proxy object."""
7070
71 def click_button_by_text(self, text):71 def click_button_by_text(self, text):
72 """Click a button on the popover.72 """Click a button on the popover.
@@ -102,7 +102,7 @@
102102
103103
104class ComposerSheet(_common.UbuntuUIToolkitCustomProxyObjectBase):104class ComposerSheet(_common.UbuntuUIToolkitCustomProxyObjectBase):
105 """ComposerSheet Autopilot emulator."""105 """ComposerSheet Autopilot custom proxy object."""
106106
107 def __init__(self, *args):107 def __init__(self, *args):
108 super(ComposerSheet, self).__init__(*args)108 super(ComposerSheet, self).__init__(*args)
109109
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/__init__.py'
--- tests/autopilot/ubuntuuitoolkit/tests/__init__.py 2014-07-22 07:44:40 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/__init__.py 2014-08-07 18:48:22 +0000
@@ -23,7 +23,8 @@
23from autopilot.matchers import Eventually23from autopilot.matchers import Eventually
24from testtools.matchers import Is, Not, Equals24from testtools.matchers import Is, Not, Equals
2525
26from ubuntuuitoolkit import base, emulators, fixture_setup26import ubuntuuitoolkit
27from ubuntuuitoolkit import base, fixture_setup
2728
2829
29_DESKTOP_FILE_CONTENTS = ("""[Desktop Entry]30_DESKTOP_FILE_CONTENTS = ("""[Desktop Entry]
@@ -91,7 +92,7 @@
91 application_name, _ = os.path.splitext(desktop_file_name)92 application_name, _ = os.path.splitext(desktop_file_name)
92 self.app = self.launch_upstart_application(93 self.app = self.launch_upstart_application(
93 application_name,94 application_name,
94 emulator_base=emulators.UbuntuUIToolkitEmulatorBase)95 emulator_base=ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase)
9596
9697
97class QMLStringAppTestCase(UbuntuUIToolkitWithFakeAppRunningTestCase):98class QMLStringAppTestCase(UbuntuUIToolkitWithFakeAppRunningTestCase):
@@ -106,7 +107,7 @@
106107
107 @property108 @property
108 def main_view(self):109 def main_view(self):
109 return self.app.select_single(emulators.MainView)110 return self.app.select_single(ubuntuuitoolkit.MainView)
110111
111112
112class FlickDirection:113class FlickDirection:
@@ -133,7 +134,7 @@
133 "-I" + _get_module_include_path(),134 "-I" + _get_module_include_path(),
134 self.test_qml_file_path,135 self.test_qml_file_path,
135 '--desktop_file_hint={0}'.format(desktop_file_path),136 '--desktop_file_hint={0}'.format(desktop_file_path),
136 emulator_base=emulators.UbuntuUIToolkitEmulatorBase,137 emulator_base=ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase,
137 app_type='qt')138 app_type='qt')
138139
139 self.assertThat(140 self.assertThat(
@@ -149,7 +150,7 @@
149150
150 @property151 @property
151 def main_view(self):152 def main_view(self):
152 return self.app.select_single(emulators.MainView)153 return self.app.select_single(ubuntuuitoolkit.MainView)
153154
154 def getOrientationHelper(self):155 def getOrientationHelper(self):
155 orientationHelper = self.main_view.select_many(156 orientationHelper = self.main_view.select_many(

Subscribers

People subscribed via source and target branches