on xenial help sign in
Fix minor issues.
e59897bYing-Chun Liu
tests/autopilot/unity8/shell/__init__.py+1−4
@@ -22,15 +22,12 @@
22from time import sleep
22from time import sleep
23from functools import wraps
23from functools import wraps
24from gi.repository import Notify
24from gi.repository import Notify
25−import ubuntuuitoolkit
26−from autopilot import introspection
27−from autopilot.introspection import dbus
28−from unity8.shell import emulators
29
25
30import logging
26import logging
31
27
32logger = logging.getLogger(__name__)
28logger = logging.getLogger(__name__)
33
29
30+
34def disable_qml_mocking(fn):
31def disable_qml_mocking(fn):
35 """Simple decorator that disables the QML mocks from being loaded."""
32 """Simple decorator that disables the QML mocks from being loaded."""
36 @wraps(fn)
33 @wraps(fn)
tests/autopilot/unity8/shell/emulators/main_window.py+5−4
@@ -175,7 +175,8 @@ class QQuickView(emulators.UnityEmulatorBase):
175 objectName='pinPadButton{}'.format(button_id)
175 objectName='pinPadButton{}'.format(button_id)
176 )
176 )
177
177
178− def wait_for_notification_dialog(self):
178+ @autopilot_logging.log_action(logger.info)
179+ def wait_for_notification(self):
179 """Wait for a notification dialog to appear.
180 """Wait for a notification dialog to appear.
180
181
181 :return: An object for the notification dialog data.
182 :return: An object for the notification dialog data.
@@ -187,6 +188,6 @@ class QQuickView(emulators.UnityEmulatorBase):
187 objectName='notificationList')
188 objectName='notificationList')
188 visible_notification = notify_list.wait_select_single('Notification',
189 visible_notification = notify_list.wait_select_single('Notification',
189 visible=True)
190 visible=True)
190− return { "summary": visible_notification.summary,
191+ return {'summary': visible_notification.summary,
191− "body": visible_notification.body,
192+ 'body': visible_notification.body,
192− "iconSource": visible_notification.iconSource }
193+ 'iconSource': visible_notification.iconSource}
tests/autopilot/unity8/shell/tests/test_notifications.py+4−3
@@ -715,7 +715,8 @@ class EphemeralNotificationsTests(NotificationsBase):
715 notification = shell.create_ephemeral_notification(summary, body)
715 notification = shell.create_ephemeral_notification(summary, body)
716 notification.show()
716 notification.show()
717
717
718− notification_data = self.main_window.wait_for_notification_dialog()
718+ notification_data = self.main_window.wait_for_notification()
719
719
720− self.assertThat(notification_data["summary"], Eventually(Equals(summary)))
720+ self.assertThat(notification_data['summary'],
721+ Eventually(Equals(summary)))
721− self.assertThat(notification_data["body"], Eventually(Equals(body)))
722+ self.assertThat(notification_data['body'], Eventually(Equals(body)))