test_simpleInstrumentController

test_simpleInstrumentController.test_simple_instrument_controller(show_plots, use_rate_limit, rate_limit, omega_mag, deviceStatus, controlStatus, useDuration, imagingTimes, expected_result)[source]

Validation Test Description

Unit test for simpleInstrumentController. The unit test specifically covers:

  1. If the controller correctly sends an image command if access and attitude error are within bounds

  2. If the controller does not image until the imaged variable is reset to 0

  3. If the controller sends an image command again after the imaged variable has been reset to 0

  4. If the rate tolerance limit only effects operation when enabled, and effects operation in the expected manner.

  5. If the controller sends an image command when deviceStatusInMsg is set to 1 and the instrumentStatus is set to 0

  6. If the controller does not send an image command when deviceStatusInMsg is set to 0 and the instrumentStatus is set to 1

  7. If the controller does send an image command when deviceStatusInMsg is not written and the instrumentStatus is set to 1

  8. If the controller correctly handles the duration-based imaging flag when set to 0 (immediate imaging)

  9. If the controller correctly handles duration-based imaging when acquisitionTime and allowedTime are set to 0

  10. If the controller correctly handles duration-based imaging when acquisitionTime and allowedTime are set to the same values (1.0 second)

  11. If the controller correctly handles duration-based imaging when acquisitionTime is set to 1.0 second and allowedTime is set to 0 second (should not image)

  12. If the controller correctly handles duration-based imaging when acquisitionTime is set to 1.0 second and allowedTime is set to 2.0 seconds (should image)

  13. If the controller correctly handles duration-based imaging when acquisitionTime is set to -1.0 second and allowedTime is set to 2.0 seconds (should image immediately)

  14. If the controller correctly handles duration-based imaging when acquisitionTime is set to 0.0 second and allowedTime is set to -1.0 seconds (should image immediately)

test_simpleInstrumentController.test_simple_instrument_controller_duration_time_window(show_plots, acquisitionTime, allowedTime, expected_result)[source]

Validation Test Description

Verify that duration-based imaging accumulates valid constraints before the capture window opens. An acquisition that completes before or inside the [1.5, 2.5] second window must capture, while an acquisition that completes after the window closes or whose allowed time expires before the window opens must not.

test_simpleInstrumentController.test_simple_instrument_controller_elapsed_time_access(show_plots, acquisitionTime, allowedTime, expected_result, expectedElapsedTime)[source]

Validation Test Description

Verify that duration-based imaging leaves the elapsed valid-constraint duration accessible for immediate, successful, and failed imaging attempts.

test_simpleInstrumentController.test_simple_instrument_controller_time_window(show_plots, timeToleranceLower, timeToleranceUpper, imagingTime, expected_result)[source]

Validation Test Description

Unit test for simpleInstrumentController time-interval imaging criteria. The unit test covers:

  1. If zero lower and upper tolerances preserve the prior behavior and do not constrain imaging time

  2. If a lower tolerance prevents imaging before the desired imaging window

  3. If an upper tolerance prevents imaging after the desired imaging window

  4. If lower and upper tolerances create an inclusive two-sided imaging window

  5. If a lower tolerance larger than the desired imaging time does not cause unsigned integer underflow