Skip to content

Commit 42301b9

Browse files
committed
test: remove duplicate stable camera ID test
1 parent 9113413 commit 42301b9

1 file changed

Lines changed: 2 additions & 63 deletions

File tree

tests/services/test_multicam_controller.py

Lines changed: 2 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -121,61 +121,6 @@ def _create(_settings):
121121
mc.start([cam])
122122

123123

124-
@pytest.mark.unit
125-
def test_controller_uses_stable_camera_id_not_display_id(qtbot, patch_factory):
126-
mc = MultiCameraController()
127-
128-
cam = CameraSettings(
129-
name="C1",
130-
backend="gentl",
131-
index=0,
132-
fps=30.0,
133-
enabled=True,
134-
properties={
135-
"gentl": {
136-
"device_id": "serial:SER0",
137-
"serial_number": "SER0",
138-
}
139-
},
140-
).apply_defaults()
141-
142-
stable_id = get_camera_id(cam)
143-
display_id = get_display_id(cam)
144-
145-
assert stable_id == "gentl:serial:SER0"
146-
assert display_id == "gentl:0"
147-
assert stable_id != display_id
148-
149-
seen = []
150-
151-
def on_ready(mfd):
152-
seen.append(mfd)
153-
154-
mc.frame_ready.connect(on_ready)
155-
156-
try:
157-
with qtbot.waitSignal(mc.all_started, timeout=1500):
158-
mc.start([cam])
159-
160-
qtbot.waitUntil(lambda: bool(seen), timeout=2000)
161-
162-
mfd = seen[-1]
163-
164-
assert mfd.source_camera_id == stable_id
165-
assert stable_id in mfd.frames
166-
assert stable_id in mfd.timestamps
167-
168-
assert display_id not in mfd.frames
169-
assert display_id not in mfd.timestamps
170-
171-
assert mfd.display_ids is not None
172-
assert mfd.display_ids[stable_id] == display_id
173-
174-
finally:
175-
with qtbot.waitSignal(mc.all_stopped, timeout=2000):
176-
mc.stop(wait=True)
177-
178-
179124
@pytest.mark.unit
180125
def test_get_camera_id_prefers_stable_device_id():
181126
cam = CameraSettings(
@@ -411,12 +356,9 @@ def test_controller_uses_stable_camera_id_not_display_id(qtbot, patch_factory):
411356
assert stable_id == "gentl:serial:SER0"
412357
assert display_id == "C1"
413358
assert stable_id != display_id
414-
seen = []
415-
416-
def on_ready(mfd):
417-
seen.append(mfd)
418359

419-
mc.frame_ready.connect(on_ready)
360+
seen = []
361+
mc.frame_ready.connect(seen.append)
420362

421363
try:
422364
with qtbot.waitSignal(mc.all_started, timeout=1500):
@@ -426,12 +368,9 @@ def on_ready(mfd):
426368

427369
mfd = seen[-1]
428370

429-
assert stable_id in mfd.frames
430-
assert mfd.display_ids[stable_id] == "C1"
431371
assert mfd.source_camera_id == stable_id
432372
assert stable_id in mfd.frames
433373
assert stable_id in mfd.timestamps
434-
435374
assert display_id not in mfd.frames
436375
assert display_id not in mfd.timestamps
437376

0 commit comments

Comments
 (0)