All Classes Functions Properties
unity8.shell.tests.UnityTestCase Class Reference
Inheritance diagram for unity8.shell.tests.UnityTestCase:
[legend]

## Public Member Functions

def | setUpClass
def | setUp
def | launch_unity
def | patch_lightdm_mock
def | assertUnityReady
def | get_dash
def | main_window

## Public Attributes

| touch
| unity_geometry_args
| grid_size

## Detailed Description

    A test case base class for the Unity shell tests.

Definition at line 81 of file __init__.py.

## Member Function Documentation

def unity8.shell.tests.UnityTestCase.launch_unity | ( |  | self,
|  |  | kwargs
| ) |  |

    Launch the unity shell, return a proxy object for it.

Definition at line 252 of file __init__.py.

def launch_unity(self, **kwargs):
"""Launch the unity shell, return a proxy object for it."""
binary_path = get_binary_path()
lib_path = get_lib_path()
logger.info(
"Lib path is '%s', binary path is '%s'",
lib_path,
binary_path
)
if self._lightdm_mock_type is None:
self.patch_lightdm_mock()
if self._qml_mock_enabled:
self._setup_extra_mock_environment_patch()
if self._data_dirs_mock_enabled:
self._patch_data_dirs()
# FIXME: we shouldn't be doing this
# $MIR_SOCKET, fallback to $XDG_RUNTIME_DIR/mir_socket and
# /tmp/mir_socket as last resort
try:
os.unlink(
os.getenv('MIR_SOCKET',
os.path.join(os.getenv('XDG_RUNTIME_DIR', "/tmp"),
"mir_socket")))
except OSError:
pass
try:
os.unlink("/tmp/mir_socket")
except OSError:
pass
app_proxy = self._launch_unity_with_upstart(
binary_path,
self.unity_geometry_args,
)
self._set_proxy(app_proxy)
# Ensure that the dash is visible before we return:
logger.debug("Unity started, waiting for it to be ready.")
self.assertUnityReady()
logger.debug("Unity loaded and ready.")
return app_proxy
unity8.shell.tests.UnityTestCase._qml_mock_enabled
_qml_mock_enabled
Definition: __init__.py:141
unity8.shell.tests.UnityTestCase._lightdm_mock_type
_lightdm_mock_type
Definition: __init__.py:140
unity8.shell.tests.UnityTestCase.patch_lightdm_mock
def patch_lightdm_mock
Definition: __init__.py:329
unity8.shell.tests.UnityTestCase.unity_geometry_args
unity_geometry_args
Definition: __init__.py:171
unity8.shell.tests.UnityTestCase._launch_unity_with_upstart
def _launch_unity_with_upstart
Definition: __init__.py:301
unity8.shell.tests.UnityTestCase._setup_extra_mock_environment_patch
def _setup_extra_mock_environment_patch
Definition: __init__.py:357
unity8.shell.tests.UnityTestCase.assertUnityReady
def assertUnityReady
Definition: __init__.py:377
unity8.shell.tests.UnityTestCase._data_dirs_mock_enabled
_data_dirs_mock_enabled
Definition: __init__.py:142
unity8.shell.tests.UnityTestCase.launch_unity
def launch_unity
Definition: __init__.py:252
unity8.shell.tests.UnityTestCase._set_proxy
def _set_proxy
Definition: __init__.py:366
unity8.shell.tests.UnityTestCase._patch_data_dirs
def _patch_data_dirs
Definition: __init__.py:324

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

- tests/autopilot/unity8/shell/tests/__init__.py