Skip to main content

test_scenario_logging Namespace

Definition​

namespace test_scenario_logging { ... }

Functions Index​

scenario_logging.RobotSnapshotInputsmake_inputs (**overrides)
make_scene_message ()
test_robot_snapshot_inputs_optional_yaml_defaults_to_none ()
test_ensure_robot_snapshot_returns_snapshot_path (tmp_path)
test_ensure_robot_snapshot_failure_raises_message_error (tmp_path)
test_scenario_writer_writes_scenario_and_snapshot (tmp_path)
test_scenario_writer_accepts_str_root (tmp_path)
test_scenario_writer_rejects_malformed_request_json (tmp_path)
test_scenario_writer_rejects_diff_scene (tmp_path)
test_scenario_input_json_round_trip ()
test_scenario_output_json_round_trip ()
test_trajectory_summary_is_copied_on_access ()
test_from_json_string_malformed_raises_message_error (record)

Variables Index​

strFIXTURES = Path(__file__).parent / "fixtures"
strURDF = FIXTURES / "scenario_logging.urdf"
strSRDF = FIXTURES / "scenario_logging.srdf"

Description​

Tests for the scenario_logging bindings and the pro_rrt scenario request/result bindings.

The C++ tests in `src/planners/scenario_logging/test/` cover the on-disk format, hashing, and quota eviction, and
`src/planners/pro_rrt/test/test_scenario_interface.cpp` covers the JSON shape. These tests cover what the bindings
add: argument marshaling, defaults, `pathlib.Path` conversion, and that `tl::expected` errors raise `MessageError`.

The fixture robot is mesh-free on purpose: `ensure_robot_snapshot` copies every mesh the URDF references, so the
`lab_sim` fixture would make each writer test resolve and copy mesh files through `ament_index`.

Functions​

make_inputs()​

scenario_logging.RobotSnapshotInputs test_scenario_logging.make_inputs (** overrides)
Snapshot inputs for the mesh-free fixture robot.

Definition at line 29 of file test_scenario_logging.py.

make_scene_message()​

test_scenario_logging.make_scene_message ()

Definition at line 36 of file test_scenario_logging.py.

test_ensure_robot_snapshot_failure_raises_message_error()​

test_scenario_logging.test_ensure_robot_snapshot_failure_raises_message_error (tmp_path tmp_path)
A snapshot that cannot be written raises `MessageError` with the C++ message.

Definition at line 67 of file test_scenario_logging.py.

test_ensure_robot_snapshot_returns_snapshot_path()​

test_scenario_logging.test_ensure_robot_snapshot_returns_snapshot_path (tmp_path tmp_path)
A `pathlib.Path` root is accepted and the snapshot directory comes back as a `pathlib.Path`.

Definition at line 51 of file test_scenario_logging.py.

test_from_json_string_malformed_raises_message_error()​

test_scenario_logging.test_from_json_string_malformed_raises_message_error (record record)
Malformed JSON raises `MessageError` for both record types.

Definition at line 230 of file test_scenario_logging.py.

test_robot_snapshot_inputs_optional_yaml_defaults_to_none()​

test_scenario_logging.test_robot_snapshot_inputs_optional_yaml_defaults_to_none ()
The two YAML overrides default to None and accept text by keyword.

Definition at line 40 of file test_scenario_logging.py.

test_scenario_input_json_round_trip()​

test_scenario_logging.test_scenario_input_json_round_trip ()
Every `ScenarioInput` field survives `to_json_string` / `from_json_string`.

Definition at line 155 of file test_scenario_logging.py.

test_scenario_output_json_round_trip()​

test_scenario_logging.test_scenario_output_json_round_trip ()
`ScenarioOutput` with a summary survives the JSON round trip.

Definition at line 192 of file test_scenario_logging.py.

test_scenario_writer_accepts_str_root()​

test_scenario_logging.test_scenario_writer_accepts_str_root (tmp_path tmp_path)
The root may be passed as `str`.

Definition at line 113 of file test_scenario_logging.py.

test_scenario_writer_rejects_diff_scene()​

test_scenario_logging.test_scenario_writer_rejects_diff_scene (tmp_path tmp_path)
A diff scene raises `MessageError`, since replay would plan in an incomplete world.

Definition at line 139 of file test_scenario_logging.py.

test_scenario_writer_rejects_malformed_request_json()​

test_scenario_logging.test_scenario_writer_rejects_malformed_request_json (tmp_path tmp_path)
A malformed `request_json` raises `MessageError` naming the problem.

Definition at line 126 of file test_scenario_logging.py.

test_scenario_writer_writes_scenario_and_snapshot()​

test_scenario_logging.test_scenario_writer_writes_scenario_and_snapshot (tmp_path tmp_path)
`write` returns the scenario directory as a `pathlib.Path` and leaves the envelope it was given unchanged.

Definition at line 81 of file test_scenario_logging.py.

test_trajectory_summary_is_copied_on_access()​

test_scenario_logging.test_trajectory_summary_is_copied_on_access ()
Reading `trajectory_summary` returns a copy, so mutating it or resetting the field cannot alias freed storage.

Definition at line 213 of file test_scenario_logging.py.

Variables​

FIXTURES​

str test_scenario_logging.FIXTURES = Path(__file__).parent / "fixtures"

Definition at line 24 of file test_scenario_logging.py.

SRDF​

str test_scenario_logging.SRDF = FIXTURES / "scenario_logging.srdf"

Definition at line 26 of file test_scenario_logging.py.

URDF​

str test_scenario_logging.URDF = FIXTURES / "scenario_logging.urdf"

Definition at line 25 of file test_scenario_logging.py.


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


Generated via doxygen2docusaurus 2.2.2 by Doxygen 1.9.8.