id3c.tests.test_check_cam_armed#
Tests for _check_cam_armed.
Mocks the cam via SimpleNamespace. The function is a plan stub
(yields bps.sleep(...) messages), so we exhaust the generator
manually and assert behaviour.
Functions#
Acquire on first poll -> generator returns with no sleeps. |
|
Error state on first poll -> RuntimeError with msg. |
|
All four error states trigger the raise. |
|
If state goes Initializing -> Initializing -> Acquire, the |
|
If state never becomes Acquire or Error within max_wait_s, |
|
A transition Initializing -> Error mid-poll is caught. |
|
If status_message.get() raises, we still raise with the |
|
If detector_state.get() raises, the helper does not raise |
Module Contents#
- id3c.tests.test_check_cam_armed.test_armed_state_returns_immediately()[source]#
Acquire on first poll -> generator returns with no sleeps.
- id3c.tests.test_check_cam_armed.test_error_state_raises_with_status_message()[source]#
Error state on first poll -> RuntimeError with msg.
- id3c.tests.test_check_cam_armed.test_each_error_state_raises()[source]#
All four error states trigger the raise.
- id3c.tests.test_check_cam_armed.test_eventual_acquire_after_polls()[source]#
If state goes Initializing -> Initializing -> Acquire, the helper yields sleeps and then returns cleanly.
- id3c.tests.test_check_cam_armed.test_timeout_does_not_raise()[source]#
If state never becomes Acquire or Error within max_wait_s, the helper returns without raising (the downstream first-frame timeout handles genuinely stuck cams).
- id3c.tests.test_check_cam_armed.test_error_after_initializing_still_raises()[source]#
A transition Initializing -> Error mid-poll is caught.