From patchwork Wed Oct 6 20:38:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 1537374 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=DAvDjVF0; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=140.211.166.133; helo=smtp2.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=) Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HPmWV1dylz9sX3 for ; Thu, 7 Oct 2021 07:38:46 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 880604079B; Wed, 6 Oct 2021 20:38:43 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IY4bAFL-6cdH; Wed, 6 Oct 2021 20:38:42 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id BD32C4022F; Wed, 6 Oct 2021 20:38:41 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 8A4D91BF34F for ; Wed, 6 Oct 2021 20:38:34 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 77B7C60F40 for ; Wed, 6 Oct 2021 20:38:33 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp3.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 96LF4UwoLjSJ for ; Wed, 6 Oct 2021 20:38:32 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by smtp3.osuosl.org (Postfix) with ESMTPS id 9571760F3E for ; Wed, 6 Oct 2021 20:38:32 +0000 (UTC) Received: by mail-wr1-x42d.google.com with SMTP id u18so12476179wrg.5 for ; Wed, 06 Oct 2021 13:38:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=TeWUEOPPhyYUxgrFDjAwaOkvbwEPoBQiUdC+HeGQ+Ss=; b=DAvDjVF0J6wnUbcHtqbwUci72WRXLOYWcQuz4t4DW2pQ7z02D5iCsEEBK/90IhPptN Tqg89dzNWHUCCzDObhhtDBh/7Dmq/g+CAuB7qshdKAaf62MuwQOaY7Qq5MJUNSyQTMwf Zi/uhNjThEtYXo/z955L7gP9r4sWIcCSGcnG8SCLPf2Gc/aD6pAVUGgEnvN5YaIJD9S7 GeV7GxjnhkSUjQ6s76jC9sYSBVtePxZhAbwcwykJuafH0cF8P7/UH3T/jhc3BORWmDF7 QbJzkg0lJ7oGV2Xi0n+RFThJSgsOd1qvXJMBRKlnkbOtkM/Hlh/brlNA3jrcgKaeaBvz KS/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=TeWUEOPPhyYUxgrFDjAwaOkvbwEPoBQiUdC+HeGQ+Ss=; b=NmyqYDc3edjcaZcPjmPnFLowFQ7Py5p82nOGEe2Ea23APqRbUniwDgWS41wk1TN+a1 UvwWTWWyeYhXfErH0DMnzbrGVXem584S/mC5JsZJgxaO1RtywlamxIxqT+dA/Pzd+wCA +FOueGSzN5Nn+wpfHPgiRuKeVpQ863/6eoLQAxGzIsz2QsPTdt2ZOXEMnzWRPbkBw0lY TbLkj3PvGPnvVeMbOAk/MKDA7Td2b/qPXPUO8EfaDtvYAfFTkBEcG4rvl8VLS4d1Nu5z Mf87zsGcRtMutG9DggcLyUnv8jkr2G9cytRkTqB04Tjx++aeCcuv4Z8fuyBXB11fYvCK ukFA== X-Gm-Message-State: AOAM531xX1Cv6yhfBfpDxj9Q+uCNn1/wHNSx/J3RH3CQiN/9vcZd4xwY qaCLqHXMj5Ndn22TfTmpSf5S81UDHTk= X-Google-Smtp-Source: ABdhPJwu3h/zhOvk4ovJzDb1enr5OMSVi+wyHFZxDFzU7HnEWJ64a6gzSONIFNEkZ4vnPYDUsDi9eQ== X-Received: by 2002:adf:ab59:: with SMTP id r25mr323347wrc.208.1633552710577; Wed, 06 Oct 2021 13:38:30 -0700 (PDT) Received: from scaer.home ([2a01:cb19:8b51:cb00:a11c:d3e8:9e5:2853]) by smtp.gmail.com with ESMTPSA id z5sm8570737wmp.26.2021.10.06.13.38.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Oct 2021 13:38:30 -0700 (PDT) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Wed, 6 Oct 2021 22:38:23 +0200 Message-Id: <20211006203823.2740442-1-yann.morin.1998@free.fr> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH] support/testing: fix python_flask_expect_python X-BeenThere: buildroot@buildroot.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Edgar Bonet , "Yann E. MORIN" , Thomas Petazzoni Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" Commit e6ee07f41a2b (package/python-flask-expects-json: new package) added a non-functional test case that, as noticed by Edgar, fails with: AssertionError: '%{http_code}' != '200' That's because the % sign is self-escaped, à-la C, in the first part of the command, probably to avoid its being %-formatted. But only the second part of the command is %-formatted, so we do not need to self-escape % in the first part. Additionally, since eb3ee3078a76 (support/testing/infra/emulator.py: prevent the commands from wrapping), we no longer need to play tricks with commands that are too long to fit on the first line of the shell prompt. Signed-off-by: Yann E. MORIN Cc: Thomas Petazzoni Cc: Edgar Bonet Reviewed-by: Thomas Petazzoni --- .../testing/tests/package/test_python_flask_expects_json.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/support/testing/tests/package/test_python_flask_expects_json.py b/support/testing/tests/package/test_python_flask_expects_json.py index b7326f5d9e..5576cba2b4 100644 --- a/support/testing/tests/package/test_python_flask_expects_json.py +++ b/support/testing/tests/package/test_python_flask_expects_json.py @@ -17,11 +17,11 @@ class TestPythonPy3FlaskExpectsJson(TestPythonPackageBase): timeout = 60 def try_json(self, payload, expects): - cmd = """curl -s -o /dev/null -w "%%{http_code}\\n" -X POST """ + cmd = """curl -s -o /dev/null -w "%{http_code}\\n" -X POST """ cmd += """-H "Content-Type: application/json" -d '%s' http://127.0.0.1:5000""" % payload output, exit_code = self.emulator.run(cmd, timeout=self.timeout) self.assertEqual(exit_code, 0) - self.assertEqual(output[-1], str(expects)) + self.assertEqual(output[0], str(expects)) def test_run(self): self.login()