From patchwork Tue Oct 17 21:57:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alassane Yattara X-Patchwork-Id: 32493 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 24F10CDB474 for ; Tue, 17 Oct 2023 21:58:02 +0000 (UTC) Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) by mx.groups.io with SMTP id smtpd.web11.268558.1697579877528351353 for ; Tue, 17 Oct 2023 14:57:58 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@savoirfairelinux.com header.s=DFC430D2-D198-11EC-948E-34200CB392D2 header.b=JXxsHqiU; spf=pass (domain: savoirfairelinux.com, ip: 208.88.110.44, mailfrom: alassane.yattara@savoirfairelinux.com) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 2DB789C3226 for ; Tue, 17 Oct 2023 17:57:56 -0400 (EDT) Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavis, port 10032) with ESMTP id 2QXTC0QfnFH6; Tue, 17 Oct 2023 17:57:55 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 3ED639C2AEF; Tue, 17 Oct 2023 17:57:55 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com 3ED639C2AEF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1697579875; bh=X2mswYSson0xhQeuSDPkGh5W5mVct11mmqCDDN0gJK4=; h=From:To:Date:Message-Id:MIME-Version; b=JXxsHqiUt4yGf8z+AEkDpTMUAdXpgrFx+SigGQEmgba/zi+koJbngt+xzDdO5EgkZ ZBry1aKMIJa6QVCLYYvTP2td0ZFR3K/o3Wz8AcQ0+c1hyKFV6IzbLWgapFUefnZaHU gJp7S7ty5EeBPUfYaicfNDOVY1vKzPuaTSILKJ7VzVq8+WvQrk6x6tpGNNWoU51dHC DriALNmZ/QjnvEglK22CjwxPSM7cvzwi5aiixOlqInAa6M9sGMXDQYebx/1QJ7Kdp3 j8VtsJRRfG1Xyzsu5uH2TEw97yi7RyrEyDNVo0uPu85EEJtr9Z3bwIGVFk71mmjhbK L/aPsjJmZ6L6A== X-Virus-Scanned: amavis at mail.savoirfairelinux.com Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavis, port 10026) with ESMTP id WIHH46Kr9FxF; Tue, 17 Oct 2023 17:57:55 -0400 (EDT) Received: from jedi.. (unknown [196.117.75.249]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id 5B70F9C2994; Tue, 17 Oct 2023 17:57:54 -0400 (EDT) From: Alassane Yattara To: toaster@lists.yoctoproject.org Cc: Alassane Yattara Subject: [PATCH v2 1/2] Toaster: bug-fix on tests/views/test_views.py Date: Tue, 17 Oct 2023 22:57:49 +0100 Message-Id: <20231017215750.511427-1-alassane.yattara@savoirfairelinux.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 17 Oct 2023 21:58:02 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/toaster/message/5871 - Create a tmp file for base recipe, otherwise test fail it doesn't exist Signed-off-by: Alassane Yattara --- lib/toaster/tests/views/test_views.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/toaster/tests/views/test_views.py b/lib/toaster/tests/views/test_views.py index f962e762..06bf6c20 100644 --- a/lib/toaster/tests/views/test_views.py +++ b/lib/toaster/tests/views/test_views.py @@ -41,7 +41,15 @@ class ViewTests(TestCase): def setUp(self): self.project = Project.objects.first() + self.recipe1 = Recipe.objects.get(pk=2) + # create a file and to recipe1 file_path + file_path = f"/tmp/{self.recipe1.name.strip().replace(' ', '-')}.bb" + with open(file_path, 'w') as f: + f.write('foo') + self.recipe1.file_path = file_path + self.recipe1.save() + self.customr = CustomImageRecipe.objects.first() self.cust_package = CustomImagePackage.objects.first() self.package = Package.objects.first()