From patchwork Thu Mar 9 14:25:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 18365 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 08ABAC329C for ; Thu, 9 Mar 2023 14:26:24 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 311B8626F0; Thu, 9 Mar 2023 15:26:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1678371981; bh=dISrbspAYCcz8jDXGpTgbn0J+SDAdO6eEhIAvVRnSUc=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=IDeh9dgf/RNT12Oty7jKUEFB22wUBA/oSzSQKDUGOThSirEmIkyCEBLfH0os+b7Du 54PMMNDTOBVgbPcClh+inSt5HLfT6r00C4N6vmCdAjcvmX5ja9SqfZjxBbu8ACtRXC 8j269X3jpTqNQW5XHNfqdieNFdZGJMuMaE4OlkFYm7s9Saqpg2d/n7yhnsVoatMRdv W+QwATofbt5Brha48o652bE35XvwvcgxCz/rC8pC2ABLF2r5TgAqmn1kgc0fT5FVvj b+PedGIPyWOYI4MN7iBJSbARMTK1ho3Zx6Fuf5+3o/T3sjR1Y2PshSNjzF+OyaFdhG 9jdqw4Vgip+nw== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 16BCE626D5 for ; Thu, 9 Mar 2023 15:26:18 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="TA4w02Fm"; dkim-atps=neutral Received: from desky.lan (91-154-32-225.elisa-laajakaista.fi [91.154.32.225]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 673B9589; Thu, 9 Mar 2023 15:26:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1678371977; bh=dISrbspAYCcz8jDXGpTgbn0J+SDAdO6eEhIAvVRnSUc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TA4w02Fm3gzu0IhQzbW0fG1GZ8KqfIPjOI3W1ATv3ql7FcnBXKIWGOulBGSgk8gdL QlVbAn64lBmHSoRlcaO3enJNoTQiKkVXk76Efb8cDco9u7B8aVyaBD+OMfaPJ375T0 6BJwM0v90HJfqTIrNOVOGCaXmgqZwGnF2ue8oFao= To: libcamera-devel@lists.libcamera.org Date: Thu, 9 Mar 2023 16:25:50 +0200 Message-Id: <20230309142601.70556-5-tomi.valkeinen@ideasonboard.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230309142601.70556-1-tomi.valkeinen@ideasonboard.com> References: <20230309142601.70556-1-tomi.valkeinen@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 04/15] py: unittests.py: Use new events support X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Tomi Valkeinen via libcamera-devel From: Tomi Valkeinen Reply-To: Tomi Valkeinen Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" 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 Reviewed-by: Laurent Pinchart --- 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 794e46be..fab791d1 100755 --- a/test/py/unittests.py +++ b/test/py/unittests.py @@ -201,9 +201,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 @@ -267,9 +267,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