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:
If the controller correctly sends an image command if access and attitude error are within bounds
If the controller does not image until the imaged variable is reset to 0
If the controller sends an image command again after the imaged variable has been reset to 0
If the rate tolerance limit only effects operation when enabled, and effects operation in the expected manner.
If the controller sends an image command when deviceStatusInMsg is set to 1 and the instrumentStatus is set to 0
If the controller does not send an image command when deviceStatusInMsg is set to 0 and the instrumentStatus is set to 1
If the controller does send an image command when deviceStatusInMsg is not written and the instrumentStatus is set to 1
If the controller correctly handles the duration-based imaging flag when set to 0 (immediate imaging)
If the controller correctly handles duration-based imaging when acquisitionTime and allowedTime are set to 0
If the controller correctly handles duration-based imaging when acquisitionTime and allowedTime are set to the same values (1.0 second)
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)
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)
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)
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:
If zero lower and upper tolerances preserve the prior behavior and do not constrain imaging time
If a lower tolerance prevents imaging before the desired imaging window
If an upper tolerance prevents imaging after the desired imaging window
If lower and upper tolerances create an inclusive two-sided imaging window
If a lower tolerance larger than the desired imaging time does not cause unsigned integer underflow