Registry¶
Data:
A list of all the hardware we expect to have at the moment. |
Functions:
|
|
|
Get one autopilot object with a specified base class and class name using a string, an enum in autopilot.utils.registry.REGISTRIES, or an object itself |
|
Test that calling |
|
Test that calling |
use the |
|
use the |
|
Test that the same object is gotten regardless of method of specifying base_class |
|
Ensure a exceptions are raised for nonsense |
- _EXPECTED_HARDWARE = ( 'autopilot.hardware.cameras.Camera', 'autopilot.hardware.cameras.Camera_CV', 'autopilot.hardware.cameras.Camera_Spinnaker', 'autopilot.hardware.gpio.Digital_In', 'autopilot.hardware.gpio.Digital_Out', 'autopilot.hardware.gpio.GPIO', 'autopilot.hardware.gpio.LED_RGB', 'autopilot.hardware.gpio.PWM', 'autopilot.hardware.gpio.Solenoid', 'autopilot.hardware.i2c.I2C_9DOF', 'autopilot.hardware.i2c.MLX90640', 'autopilot.hardware.usb.Scale', 'autopilot.hardware.usb.Wheel')¶
A list of all the hardware we expect to have at the moment.
This doesn’t need to be maintained exactly, but is just used as an independent source of expectation for which Hardware objects we can expect.
So in all tests that use it, this tests a minimal expectation, ie. that we get all the values that we should get if this were up to date, knowing that it might not be.
- test_get_one(base_class, class_name)[source]¶
Get one autopilot object with a specified base class and class name using a string, an enum in autopilot.utils.registry.REGISTRIES, or an object itself
- test_get_all(base_class)[source]¶
Test that calling
get
with noclass_name
argument returns all the objects for that registry
- test_get_subtree(logger_registry_get, caplog)[source]¶
Test that calling
get
with a child of a top-level object (egGPIO
rather thanHardware
) gets all its children, (using GPIO as the test case)
- test_get_hardware()[source]¶
use the
autopilot.utils.registry.get_hardware()
aliasmostly a formality to keep it working since the underlying function is tested elsewhere
- test_get_task()[source]¶
use the
autopilot.utils.registry.get_task()
aliasmostly a formality to keep it working since the underlying function is tested elsewhere