From patchwork Tue Oct 17 21:37:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alassane Yattara X-Patchwork-Id: 32492 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 17A7ACDB474 for ; Tue, 17 Oct 2023 21:38:12 +0000 (UTC) Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) by mx.groups.io with SMTP id smtpd.web11.268076.1697578685189497041 for ; Tue, 17 Oct 2023 14:38:06 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@savoirfairelinux.com header.s=DFC430D2-D198-11EC-948E-34200CB392D2 header.b=XYXLhRK1; 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 C922C9C2CAF for ; Tue, 17 Oct 2023 17:38:03 -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 8wbs5ZYZHe2i; Tue, 17 Oct 2023 17:38:03 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 335059C324C; Tue, 17 Oct 2023 17:38:03 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com 335059C324C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1697578683; bh=Vt3/4iD6mYcSn2x/YPbxfRL88xLgmJrkPhfRDasLHcI=; h=From:To:Date:Message-Id:MIME-Version; b=XYXLhRK1BNoHTY0eMlDXGfh/vhB2xXya3yoAEDcalMMVoN/VVzljo4m225xCkI+6E dNxZIcDPr558MQ51sNOzpSqjgoHSJBUEusZydCusnPGLok1Tzo4zK0FavoStXiKdVt uK2vezfjQy0YLilhtFM57x2rDQEuLIIANCkaiunRJy24swI96841K98b0WuMZAx53E 3FPz/a+EoEWmE9jjPFkOXbHMm5fQaNkOX63838xqQ+Es7yvR9iQ8J1H8568DHd5r6m KGCZHCjcnMaHqB6wQCAw9UErW6bezrAD/AgNMztbF5Ii12lprdp9DKB8PfrkfmBhGp Oe/OlZ/8iUd4A== 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 wvsbyT61ohyS; Tue, 17 Oct 2023 17:38:03 -0400 (EDT) Received: from jedi.. (unknown [196.117.75.249]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id 690E89C2CAF; Tue, 17 Oct 2023 17:38:02 -0400 (EDT) From: Alassane Yattara To: toaster@lists.yoctoproject.org Cc: Alassane Yattara Subject: [PATCH 1/2] Toaster: bug-fix on tests/views/test_views.python3 Date: Tue, 17 Oct 2023 22:37:54 +0100 Message-Id: <20231017213755.479949-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:38:12 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/toaster/message/5870 - Create a tmp file for base recipe, otherwise test fail it doesn't exist --- 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()