Loading...
Searching...
No Matches
lomiri.shell.tests.test_notifications.NotificationsBase Class Reference
Inheritance diagram for lomiri.shell.tests.test_notifications.NotificationsBase:
[legend]
Collaboration diagram for lomiri.shell.tests.test_notifications.NotificationsBase:
[legend]

## Static Public Attributes

| scenarios

## Protected Member Functions

| _get_icon_path (self, icon_name)
| _get_notifications_list (self)
| _assert_notification (self, notification, summary=None, body=None, icon=True, secondary_icon=False, opacity=None)
Protected Member Functions inherited from lomiri.shell.tests.LomiriTestCase
| _setup_display_details (self)
| _determine_geometry (self)
| _setup_grid_size (self, scale_divisor)
| _geo_larger_than_display (self, width, height)
| _get_scaled_down_geo (self, width, height)
| _launch_lomiri_with_upstart (self, binary_path, args)
| _patch_data_dirs (self)
| _get_lightdm_mock_path (self)
| _set_proxy (self, proxy)
| _clear_proxy (self)

## Additional Inherited Members

Public Member Functions inherited from lomiri.shell.tests.LomiriTestCase
| setUpClass (cls)
| setUp (self)
| launch_lomiri (self, mode="full-greeter", *args)
| patch_lightdm_mock (self)
| wait_for_lomiri (self)
| get_dash (self)
| main_window (self)
Public Attributes inherited from lomiri.shell.tests.LomiriTestCase
list | lomiri_geometry_args = []
int | grid_size = 8
Protected Attributes inherited from lomiri.shell.tests.LomiriTestCase
| _proxy = None
bool | _qml_mock_enabled = True
bool | _data_dirs_mock_enabled = True
dict | _environment = {}
| _clear_proxy

## Detailed Description

    Base class for all notification tests that provides helper methods.

Definition at line 41 of file test_notifications.py.

## Member Function Documentation

## _assert_notification()

lomiri.shell.tests.test_notifications.NotificationsBase._assert_notification | ( |  | self,
|  |  | notification,
|  |  | summary = None,
|  |  | body = None,
|  |  | icon = True,
|  |  | secondary_icon = False,
|  |  | opacity = None )

protected

    Assert that the expected qualities of a notification are as
    expected.

Definition at line 72 of file test_notifications.py.

):
"""Assert that the expected qualities of a notification are as
expected.
"""
if summary is not None:
self.assertThat(notification.summary, Eventually(Equals(summary)))
if body is not None:
self.assertThat(notification.body, Eventually(Equals(body)))
if icon:
self.assertThat(notification.iconSource, Eventually(NotEquals("")))
else:
self.assertThat(notification.iconSource, Eventually(Equals("")))
if secondary_icon:
self.assertThat(
notification.secondaryIconSource,
Eventually(NotEquals(""))
)
else:
self.assertThat(
notification.secondaryIconSource,
Eventually(Equals(""))
)
if opacity is not None:
self.assertThat(notification.opacity, Eventually(Equals(opacity)))

## _get_icon_path()

lomiri.shell.tests.test_notifications.NotificationsBase._get_icon_path | ( |  | self,
|  |  | icon_name )

protected

    Given an icons file name returns the full path (either system or
    source tree.

    Consider the graphics directory as root so for example (running tests
    from installed lomiri-autopilot package):
    >>> self.get_icon_path('clock.png')
    /usr/share/lomiri/graphics/clock.png

    >>> self.get_icon_path('applicationIcons/facebook.png')
    /usr/share/lomiri/graphics/applicationIcons/facebook.png

Definition at line 47 of file test_notifications.py.

def _get_icon_path(self, icon_name):
"""Given an icons file name returns the full path (either system or
source tree.
Consider the graphics directory as root so for example (running tests
from installed lomiri-autopilot package):
>>> self.get_icon_path('clock.png')
/usr/share/lomiri/graphics/clock.png
>>> self.get_icon_path('applicationIcons/facebook.png')
/usr/share/lomiri/graphics/applicationIcons/facebook.png
"""
if os.path.abspath(__file__).startswith('/usr/'):
return '/usr/share/lomiri/graphics/' + icon_name
else:
return os.path.dirname(__file__) + (
"/../../../../../tests/graphics/" + icon_name)

## _get_notifications_list()

lomiri.shell.tests.test_notifications.NotificationsBase._get_notifications_list | ( |  | self | ) |

protected

Definition at line 66 of file test_notifications.py.

def _get_notifications_list(self):
return self.main_window.select_single(
"Notifications",
objectName='notificationList'
)

## Member Data Documentation

## scenarios

lomiri.shell.tests.test_notifications.NotificationsBase.scenarios

static

Initial value:
= lomiri_scenarios.get_device_simulation_scenarios(
lomiri_scenarios.NEXUS4_DEVICE)

Definition at line 44 of file test_notifications.py.

The documentation for this class was generated from the following file:

- tests/autopilot/lomiri/shell/tests/test_notifications.py