simulation.utils.drive_test package

Submodules

simulation.utils.drive_test.drive_test_cmd module

Classes:

DriveTestCmd(*, desc[, must_succeed, ...])

Simple Wrapper of ROSCmd to run drive tests.

class DriveTestCmd(*, desc: str, must_succeed: bool = False, environment: Dict[str, Any] | None = None, **ros_args)[source]

Bases: ROSCmd

Simple Wrapper of ROSCmd to run drive tests.

Attributes:

success

If the command has ran successfully.

rosbag_path

The directory where the rosbags are stored.

keep_rosbag

Keep rosbag in every case.

desc

Description of the drive.

must_succeed

If the command has to succeed.

Methods:

run()

Prepare and run the command.

success: bool = False

If the command has ran successfully.

cmd_base: str

Command string without any arguments.

rosbag_path: str = None

The directory where the rosbags are stored.

keep_rosbag: bool = False

Keep rosbag in every case.

desc: str = None

Description of the drive.

must_succeed: bool = False

If the command has to succeed.

run() str[source]

Prepare and run the command.

Returns:

Returncode and std output.

simulation.utils.drive_test.run module

Functions:

make_multiline(string, max_width)

Classes:

Color()

Adds color to string for stdout.

AutomatedDriveTest(config, runner_index, ...)

Automated Drive Testing.

make_multiline(string: str, max_width: int)[source]
class Color[source]

Bases: object

Adds color to string for stdout.

Methods:

ansi(color_code)

Returns a callable function to which a string can be parsed.

success()

Adds green to the text.

failure()

Adds red to the text.

static ansi(color_code: int) Callable[[str], str][source]

Returns a callable function to which a string can be parsed. The string will be colored in the color of the ansi color code.

Parameters:

color_code – The ansi color code in which the string should be colored. Take a look at https://en.wikipedia.org/wiki/ANSI_escape_code#Colors

Returns:

A callable function colorize to which a string can be parsed

success() str

Adds green to the text.

failure() str

Adds red to the text.

class AutomatedDriveTest(config: str, runner_index: int | None, total_runners: int | None)[source]

Bases: object

Automated Drive Testing.

Methods:

execute()

Execute tests inside self.pipeline.

show_results()

Print the table of results to stdout.

check()

Check if tests were successful (atleast the ones that should succeed).

execute()[source]

Execute tests inside self.pipeline.

show_results()[source]

Print the table of results to stdout.

check()[source]

Check if tests were successful (atleast the ones that should succeed).

Module contents