Admit onboard camera preview only after its acquisition producer is ready
This commit is contained in:
@@ -1984,3 +1984,18 @@ def test_service_publishes_two_dynamic_camera_rows_and_stale_stop_is_safe(
|
||||
)
|
||||
finally:
|
||||
service.close()
|
||||
|
||||
|
||||
def test_onboard_preview_never_spawns_a_camera_producer(tmp_path, monkeypatch):
|
||||
gateway = _gateway(tmp_path, monkeypatch)
|
||||
try:
|
||||
selected = gateway.select("sensor.camera.right", "192.168.1.20")
|
||||
monkeypatch.setattr(
|
||||
gateway, "_spawn_selected_producer",
|
||||
lambda: pytest.fail("an onboard preview must not own camera activation"),
|
||||
)
|
||||
with pytest.raises(RuntimeError, match="producer is not ready"):
|
||||
gateway.open_delivery(selected["generation"], require_recording=True)
|
||||
assert gateway.snapshot()["recording"]["producer_alive"] is False
|
||||
finally:
|
||||
gateway.close()
|
||||
|
||||
Reference in New Issue
Block a user