[libcamera-devel] [PATCH v5 05/13] py: unittests.py: Use new events support
Tomi Valkeinen
tomi.valkeinen at ideasonboard.com
Sat Jun 3 09:56:07 CEST 2023
Update the Python unittests to use the new event model. The unittests
expect a controlled environment to be run on, and the tests will fail if
we get any other event but RequestCompleted (e.g. camera connected).
Signed-off-by: Tomi Valkeinen <tomi.valkeinen at ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
---
test/py/unittests.py | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/test/py/unittests.py b/test/py/unittests.py
index fe1e8ef0..0c844a20 100755
--- a/test/py/unittests.py
+++ b/test/py/unittests.py
@@ -217,9 +217,9 @@ class SimpleCaptureMethods(CameraTesterBase):
if not events:
continue
- ready_reqs = cm.get_ready_requests()
-
- reqs += ready_reqs
+ for ev in cm.get_events():
+ self.assertEqual(ev.type, libcam.Event.Type.RequestCompleted)
+ reqs.append(ev.request)
if len(reqs) == num_bufs:
break
@@ -283,9 +283,9 @@ class SimpleCaptureMethods(CameraTesterBase):
while running:
events = sel.select()
for key, _ in events:
- ready_reqs = cm.get_ready_requests()
-
- reqs += ready_reqs
+ for ev in cm.get_events():
+ self.assertEqual(ev.type, libcam.Event.Type.RequestCompleted)
+ reqs.append(ev.request)
if len(reqs) == num_bufs:
running = False
--
2.34.1
More information about the libcamera-devel
mailing list