Loading...
Searching...
No Matches
lomiri.fixture_setup.RestartLomiriWithTestability Class Reference

## Public Member Functions

| __init__ (self, binary_path, variables)
| setUp (self)
| restart_lomiri (self)
| restart_lomiri_with_testability (self)
| stop_lomiri (self)

## Public Attributes

| binary_path = binary_path
| variables = variables
| stop_lomiri

## Static Public Attributes

| lomiri_proxy = None

## Protected Member Functions

| _unlink_mir_socket (self)

## Detailed Description

    Fixture to launch Lomiri with testability.

    :ivar lomiri_proxy: The Autopilot proxy object for the Lomiri shell.

Definition at line 155 of file fixture_setup.py.

## Constructor & Destructor Documentation

## __init__()

lomiri.fixture_setup.RestartLomiriWithTestability.__init__ | ( |  | self,
|  |  | binary_path,
|  |  | variables )

    Initialize the fixture instance.

    :param str binary_path: The path to the Dash app binary.
    :param cli_arguments: The arguments to pass when launching the
    :param variables: The variables to use when launching the app.
    :type variables: A dictionary.

Definition at line 165 of file fixture_setup.py.

def __init__(self, binary_path, variables):
"""Initialize the fixture instance.
:param str binary_path: The path to the Dash app binary.
:param cli_arguments: The arguments to pass when launching the
:param variables: The variables to use when launching the app.
:type variables: A dictionary.
"""
super().__init__()
self.binary_path = binary_path
self.variables = variables

## Member Function Documentation

## _unlink_mir_socket()

lomiri.fixture_setup.RestartLomiriWithTestability._unlink_mir_socket | ( |  | self | ) |

protected

Definition at line 199 of file fixture_setup.py.

def _unlink_mir_socket(self):
# 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

## restart_lomiri()

lomiri.fixture_setup.RestartLomiriWithTestability.restart_lomiri | ( |  | self | ) |

Definition at line 184 of file fixture_setup.py.

def restart_lomiri(self):
self.restart_lomiri_with_testability()

## restart_lomiri_with_testability()

lomiri.fixture_setup.RestartLomiriWithTestability.restart_lomiri_with_testability | ( |  | self | ) |

Definition at line 187 of file fixture_setup.py.

def restart_lomiri_with_testability(self):
self._unlink_mir_socket()
binary_arg = 'BINARY={}'.format(self.binary_path)
variable_args = [
'{}={}'.format(key, value) for key, value in self.variables.items()
]
all_args = [binary_arg] + variable_args
self.lomiri_proxy = process_helpers.restart_lomiri_with_testability(
*all_args)

## setUp()

lomiri.fixture_setup.RestartLomiriWithTestability.setUp | ( |  | self | ) |

    Restart lomiri with testability when the fixture is used.

Definition at line 178 of file fixture_setup.py.

def setUp(self):
"""Restart lomiri with testability when the fixture is used."""
super().setUp()
self.addCleanup(self.stop_lomiri)
self.restart_lomiri()

## stop_lomiri()

lomiri.fixture_setup.RestartLomiriWithTestability.stop_lomiri | ( |  | self | ) |

Definition at line 215 of file fixture_setup.py.

def stop_lomiri(self):
process_helpers.stop_job('lomiri')

## Member Data Documentation

## binary_path

lomiri.fixture_setup.RestartLomiriWithTestability.binary_path = binary_path

Definition at line 175 of file fixture_setup.py.

## lomiri_proxy

lomiri.fixture_setup.RestartLomiriWithTestability.lomiri_proxy = None

static

Definition at line 163 of file fixture_setup.py.

## stop_lomiri

lomiri.fixture_setup.RestartLomiriWithTestability.stop_lomiri

Definition at line 181 of file fixture_setup.py.

## variables

lomiri.fixture_setup.RestartLomiriWithTestability.variables = variables

Definition at line 176 of file fixture_setup.py.

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

- tests/autopilot/lomiri/fixture_setup.py