Registry

Data:

_EXPECTED_HARDWARE

A list of all the hardware we expect to have at the moment.

Functions:

logger_registry_get(caplog)

test_get_one(base_class, class_name)

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)

Test that calling get with no class_name argument returns all the objects for that registry

test_get_subtree(logger_registry_get, caplog)

Test that calling get with a child of a top-level object (eg GPIO rather than Hardware) gets all its children, (using GPIO as the test case)

test_get_hardware()

use the autopilot.utils.registry.get_hardware() alias

test_get_task()

use the autopilot.utils.registry.get_task() alias

test_get_equivalence()

Test that the same object is gotten regardless of method of specifying base_class

test_except_on_failure()

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.

logger_registry_get(caplog)[source]
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 no class_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 (eg GPIO rather than Hardware) gets all its children, (using GPIO as the test case)

test_get_hardware()[source]

use the autopilot.utils.registry.get_hardware() alias

mostly a formality to keep it working since the underlying function is tested elsewhere

test_get_task()[source]

use the autopilot.utils.registry.get_task() alias

mostly a formality to keep it working since the underlying function is tested elsewhere

test_get_equivalence()[source]

Test that the same object is gotten regardless of method of specifying base_class

test_except_on_failure()[source]

Ensure a exceptions are raised for nonsense