From patchwork Sat Jun 3 07:56:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 18690 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 81BBBC3200 for ; Sat, 3 Jun 2023 07:57:18 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 1244A62886; Sat, 3 Jun 2023 09:57:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1685779038; bh=kJHjyipMYAIbHcbAZy0LPyQnHVkzeNbGTkQwN4dtcLM=; 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=ky5f7MRsSoVHBzifmm26guUUjSb4IIaena0/rP+VleWwYpSh3hveUwyHAT7WgXVOZ DzNM3MMhWqnRjzR+mSk06RqnxsfJL0UvsrfAsngrdIW6SKtT2IU6b6fdtzqQHxI0Nn va1eEm21pI1A0MTmS+Iph5NFof906fy1T9+rqTZ/+dVn2QSbacSYW3zcZ6K4qH1gVF oxUl7yTg0pP1cq4qnvAB+p1BpPQ0DY7nVNfBk6+iitm7yK80wRvSU8pwXP1+kWgaIu myldGTQoex0pD948/9aISB8L2EXN0yF+71xlgG9PUqXfTT+QaAM4lgDtbYUS7rtPvV eTUwC1XYL5gJQ== 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 C2E886287C for ; Sat, 3 Jun 2023 09:57:11 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="BiLJSbwa"; dkim-atps=neutral Received: from desky.lan (91-154-35-171.elisa-laajakaista.fi [91.154.35.171]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 47507B2A; Sat, 3 Jun 2023 09:56:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1685779008; bh=kJHjyipMYAIbHcbAZy0LPyQnHVkzeNbGTkQwN4dtcLM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BiLJSbwa/pTGVq51Ndblr+pTXrhVLeeCv9BHfhpqudwG9YslGipodnUUf1xrYQzwr bnjmpkRaSTnoTTVL0vOCH52lxX1ig5HegNZNz/232cPaU0bk8mES1EVxRyyOm0J5GJ 2zukweRwo/DIassM8/tlpaRlzibH7UyVFqvTPo6w= To: libcamera-devel@lists.libcamera.org Date: Sat, 3 Jun 2023 10:56:07 +0300 Message-Id: <20230603075615.20663-6-tomi.valkeinen@ideasonboard.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230603075615.20663-1-tomi.valkeinen@ideasonboard.com> References: <20230603075615.20663-1-tomi.valkeinen@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v5 05/13] 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 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