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

## Public Member Functions

| __init__ (self, action_delay, ensure_not_running=True)
| setUp (self)
| launch_service (self)
| stop_service (self)
| ensure_service_not_running (self)

## Public Attributes

| action_delay = action_delay
| ensure_not_running = ensure_not_running
| stop_service
| application_proxy = self.launch_service()

## Detailed Description

    Fixture to launch the indicator test service.

Definition at line 291 of file fixture_setup.py.

## Constructor & Destructor Documentation

## __init__()

lomiri.fixture_setup.LaunchMockIndicatorService.__init__ | ( |  | self,
|  |  | action_delay,
|  |  | ensure_not_running = True )

    Initialize an instance.

    :param action_delay: The delay to use when activating actions.
      Measured in milliseconds. Value of -1 will result in infinite delay.
    :type action_delay: An integer.
    :param boolean ensure_not_running: Make sure service is not running

Definition at line 295 of file fixture_setup.py.

def __init__(self, action_delay, ensure_not_running=True):
"""Initialize an instance.
:param action_delay: The delay to use when activating actions.
Measured in milliseconds. Value of -1 will result in infinite delay.
:type action_delay: An integer.
:param boolean ensure_not_running: Make sure service is not running
"""
super(LaunchMockIndicatorService, self).__init__()
self.action_delay = action_delay
self.ensure_not_running = ensure_not_running

## Member Function Documentation

## ensure_service_not_running()

lomiri.fixture_setup.LaunchMockIndicatorService.ensure_service_not_running | ( |  | self | ) |

Definition at line 327 of file fixture_setup.py.

def ensure_service_not_running(self):
if process_helpers.is_job_running('lomiri-mock-indicator-service'):
self.stop_service()

## launch_service()

lomiri.fixture_setup.LaunchMockIndicatorService.launch_service | ( |  | self | ) |

Definition at line 315 of file fixture_setup.py.

def launch_service(self):
logger.info("Starting lomiri-mock-indicator-service")
binary_path = get_binary_path('lomiri-mock-indicator-service')
binary_arg = 'BINARY={}'.format(binary_path)
env_args = 'ARGS=-t {}'.format(self.action_delay)
all_args = [binary_arg, env_args]
process_helpers.start_job('lomiri-mock-indicator-service', *all_args)

## setUp()

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

Definition at line 308 of file fixture_setup.py.

def setUp(self):
super().setUp()
if self.ensure_not_running:
self.ensure_service_not_running()
self.addCleanup(self.stop_service)
self.application_proxy = self.launch_service()

## stop_service()

lomiri.fixture_setup.LaunchMockIndicatorService.stop_service | ( |  | self | ) |

Definition at line 323 of file fixture_setup.py.

def stop_service(self):
logger.info("Stopping lomiri-mock-indicator-service")
process_helpers.stop_job('lomiri-mock-indicator-service')

## Member Data Documentation

## action_delay

lomiri.fixture_setup.LaunchMockIndicatorService.action_delay = action_delay

Definition at line 305 of file fixture_setup.py.

## application_proxy

lomiri.fixture_setup.LaunchMockIndicatorService.application_proxy = self.launch_service()

Definition at line 313 of file fixture_setup.py.

## ensure_not_running

lomiri.fixture_setup.LaunchMockIndicatorService.ensure_not_running = ensure_not_running

Definition at line 306 of file fixture_setup.py.

## stop_service

lomiri.fixture_setup.LaunchMockIndicatorService.stop_service

Definition at line 312 of file fixture_setup.py.

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

- tests/autopilot/lomiri/fixture_setup.py