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#

test_armed_state_returns_immediately()

Acquire on first poll -> generator returns with no sleeps.

test_error_state_raises_with_status_message()

Error state on first poll -> RuntimeError with msg.

test_each_error_state_raises()

All four error states trigger the raise.

test_eventual_acquire_after_polls()

If state goes Initializing -> Initializing -> Acquire, the

test_timeout_does_not_raise()

If state never becomes Acquire or Error within max_wait_s,

test_error_after_initializing_still_raises()

A transition Initializing -> Error mid-poll is caught.

test_status_message_get_failure_is_safe()

If status_message.get() raises, we still raise with the

test_detector_state_get_failure_is_safe()

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.

id3c.tests.test_check_cam_armed.test_status_message_get_failure_is_safe()[source]#

If status_message.get() raises, we still raise with the detector_state info.

id3c.tests.test_check_cam_armed.test_detector_state_get_failure_is_safe()[source]#

If detector_state.get() raises, the helper does not raise spuriously; it just keeps polling until the max_wait_s expires.