launch_testing.legacy package

Submodules

Module contents

class launch_testing.legacy.LaunchTestService

Bases: object

add_fixture_action(launch_description, action, exit_allowed=[0])

Add action used as testing fixture.

If a process action and it exits, a shutdown event is emitted.

add_output_test(launch_description, action, output_test, test_suffix='output', output_filter=None, side_effect=None)

Test an action process’ output against a given test.

Parameters:
  • launch_description – test launch description that owns the given action.

  • action – launch action to test whose output is to be tested.

  • output_test – test tuple as returned by launch_testing.output.create_* functions.

  • test_suffix – an optional test suffix to disambiguate multiple test instances,

defaults to ‘output’. :param output_filter: an optional function to filter out i.e. ignore output lines for the test. :param side_effect: an optional side effect of a passing test, currently only ‘shutdown’ is supported.

add_test_action(launch_description, action)

Add action used for testing.

If either all test actions have completed or a process action has exited with a non-zero return code, a shutdown event is emitted.

run(launch_service, *args, **kwargs)

Invoke the run method of the launch service.

Returns:

If the return value of the parent method is zero but any of the test processes exited with a non-zero return code the return of the first failed test process is returned.