Testing API

class sdc_scissor.testing_api.test.Test(test_id, road_points: list[list], test_outcome, test_duration=None)
__init__(test_id, road_points: list[list], test_outcome, test_duration=None)

Class representing a test case.

Parameters:
  • test_id – Unique test identifier

  • road_points – Road points defining the test

  • test_outcome – Outcome of the test execution

  • test_duration – The duration of the test execution

save_as_json(file_path: Path)

Save the test as a JSON file.

Parameters:

file_path – File path to save the test as a json file

class sdc_scissor.testing_api.test_generator.TestKeepingBehavior
abstract keep(test: Test, collection: list)
abstract generate_id(test: Test, generator) int
class sdc_scissor.testing_api.test_generator.KeepAllTestsBehavior
keep(test: Test, collection: list)
generate_id(test: Test, generator) int
class sdc_scissor.testing_api.test_generator.KeepValidTestsOnlyBehavior
keep(test: Test, collection: list)
generate_id(test: Test, generator) int
class sdc_scissor.testing_api.test_generator.TestGenerator(count: int, destination: Path, tool: str, validator: TestValidator, test_keeping_behavior: TestKeepingBehavior)
__init__(count: int, destination: Path, tool: str, validator: TestValidator, test_keeping_behavior: TestKeepingBehavior)

This class is used to generate tests for a virtual environment.

generate()

Generate tests according to the parameters set while instantiating this object.

save_tests()

Save the tests as json files in a separate directory.

class sdc_scissor.testing_api.test_loader.TestLoader(tests_dir: Path, test_validator: TestValidator)
__init__(tests_dir: Path, test_validator: TestValidator)
Parameters:

tests_dir

has_next() bool
Returns:

next() tuple[Test, Path]
Returns:

class sdc_scissor.testing_api.test_monitor.TestMonitor(simulator: AbstractSimulator, oob: float, can_bus_handler: CanBusHandler)

The test monitor checks the execution states of the test and logs them.

__init__(simulator: AbstractSimulator, oob: float, can_bus_handler: CanBusHandler)

The test monitor retrieves data from the simulator and tracks the trajectory of the car.

Parameters:
  • simulator – The simulator object to get the data from.

  • test – The test object.

  • oob – Parameter to define how much percentage the car is allowed to be off the lane.

reset()
process_car_state(interrupt_on_failure)

Checks the current state of the vehicle and test execution.

Parameters:

interrupt_on_failure – Boolean flag if the test should be interrupted when the car drives off the lane.

is_car_moving() bool

Checks if the car is currently moving.

start_timer()

Start the timer for the test execution.

stop_timer()

Stop the timer for the test execution.

dump_data()