From patchwork Fri Nov 2 04:12:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Martincoski X-Patchwork-Id: 992181 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ZGLtGysQ"; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42mTGb5RNnzB4R1 for ; Fri, 2 Nov 2018 15:13:59 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 52FCF254B8; Fri, 2 Nov 2018 04:13:58 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NBl53H-fVBaG; Fri, 2 Nov 2018 04:13:57 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 4499D25043; Fri, 2 Nov 2018 04:13:57 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 9DF1E1BF4DA for ; Fri, 2 Nov 2018 04:13:55 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 9A94586D73 for ; Fri, 2 Nov 2018 04:13:55 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8rCHFl8QnfB8 for ; Fri, 2 Nov 2018 04:13:55 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-qk1-f193.google.com (mail-qk1-f193.google.com [209.85.222.193]) by whitealder.osuosl.org (Postfix) with ESMTPS id E977A86D2F for ; Fri, 2 Nov 2018 04:13:54 +0000 (UTC) Received: by mail-qk1-f193.google.com with SMTP id d19so1138616qkg.5 for ; Thu, 01 Nov 2018 21:13:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=En2e/a5YJJxuVon1EnmuszKuapLyKQMbniI0glImFd0=; b=ZGLtGysQ9YbNbqJrL0GnbhcwAEMQzeInld/mP23N2i/mx2BNpRABswS+o1G0h1SWnI Aly7ie/ZUUW+vBOFn7e3auev1qtn41J5YyUlkvGsPTF7bL0S8A7ZrFxmTKqnTSJUmdS+ xCBz2QcJmTa/khFU5tXBNctcCIGT+dnDRNGXswuUA/ooVv8GEuUZkZ0Cb2dpLbZFQ5ou WJkmcCmev5dGzebEWnwCiF/4pjjdba7uIEjjGpzlbQzEoCGxgF1NU8BPRt0x7hgNDpqG yISa6az8dpgHFtr6/mPt2FuAXUWwZTr41gzRFGvjU/VniXQ22BaozjE/ATUibqkq6vtK P6ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=En2e/a5YJJxuVon1EnmuszKuapLyKQMbniI0glImFd0=; b=I5TBJwG2uIEUTEoD2oTdqwAu5S99I4YjDw1739u7RV1zwBAuBx6lZh9tkWFzxwj47N Q1AHFpeT1xYAyLtjAXVMdighC0nRHatQFCAWQDjxwjxyG+DfIKbFuFGmUeyyATqdYcY4 ZTsJh1fnW3GUWKMb8t+HO4xKAGTv6eYyPY1R4QXxoXlEeXROASDa4q5CqYkQhy4Ik8vs NeNx9iZek2SP2GYQTSW9CJoPoBRUEcEilr7RJ68H98nuPFaDOfbOQ0JjREN7swsXsDfm K++Sq130TkJAY1/J2D2UDz8oEBTdCvyVpd/zzmTb6qoy5xZo6QL+7aC81l8jSBOk3g4n 98LA== X-Gm-Message-State: AGRZ1gKqUf8RtJVNR+dbdRDbAMGAIYp9UgdkWBhLj/VQ3KkAq9fJGeu8 SpJnzcD1AcVrlfYWTUWCMHS5Dl4X X-Google-Smtp-Source: AJdET5fOFWIKDNcxlyoHqjUHTtMBjFMEvIqUQWjuUJsRmFpsVzrAX390awV17paNJkoarCH1tzrx8Q== X-Received: by 2002:a37:54a:: with SMTP id 71mr8960954qkf.253.1541132033951; Thu, 01 Nov 2018 21:13:53 -0700 (PDT) Received: from ultri5.home ([179.181.159.8]) by smtp.gmail.com with ESMTPSA id 83sm32849688qkz.73.2018.11.01.21.13.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Nov 2018 21:13:53 -0700 (PDT) From: Ricardo Martincoski To: buildroot@buildroot.org Date: Fri, 2 Nov 2018 01:12:38 -0300 Message-Id: <20181102041241.28910-10-ricardo.martincoski@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181102041241.28910-1-ricardo.martincoski@gmail.com> References: <20181102041241.28910-1-ricardo.martincoski@gmail.com> In-Reply-To: <20181016004230.10393-1-ricardo.martincoski@gmail.com> References: <20181016004230.10393-1-ricardo.martincoski@gmail.com> Subject: [Buildroot] [PATCH v2 09/12] support/testing: use TestPythonPackageBase for python-txaio X-BeenThere: buildroot@busybox.net 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: Thomas Petazzoni , Asaf Kahlon , Ricardo Martincoski MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Move the test scripts to be run on the target from inline in the test case to a separate file. Signed-off-by: Ricardo Martincoski Cc: Arnout Vandecappelle Cc: Asaf Kahlon Cc: Thomas Petazzoni Cc: Yegor Yefremov --- Changes v1 -> v2: - refresh after creating TestPythonPackageBase; --- .../package/sample_python_txaio_asyncio.py | 3 ++ .../package/sample_python_txaio_twisted.py | 3 ++ .../tests/package/test_python_txaio.py | 28 +++++-------------- 3 files changed, 13 insertions(+), 21 deletions(-) create mode 100644 support/testing/tests/package/sample_python_txaio_asyncio.py create mode 100644 support/testing/tests/package/sample_python_txaio_twisted.py diff --git a/support/testing/tests/package/sample_python_txaio_asyncio.py b/support/testing/tests/package/sample_python_txaio_asyncio.py new file mode 100644 index 0000000000..77f11ed807 --- /dev/null +++ b/support/testing/tests/package/sample_python_txaio_asyncio.py @@ -0,0 +1,3 @@ +import txaio +txaio.use_asyncio() +f0 = txaio.create_future() diff --git a/support/testing/tests/package/sample_python_txaio_twisted.py b/support/testing/tests/package/sample_python_txaio_twisted.py new file mode 100644 index 0000000000..13ea82a961 --- /dev/null +++ b/support/testing/tests/package/sample_python_txaio_twisted.py @@ -0,0 +1,3 @@ +import txaio +txaio.use_twisted() +f0 = txaio.create_future() diff --git a/support/testing/tests/package/test_python_txaio.py b/support/testing/tests/package/test_python_txaio.py index 6b285fb083..76e5f5230f 100644 --- a/support/testing/tests/package/test_python_txaio.py +++ b/support/testing/tests/package/test_python_txaio.py @@ -1,32 +1,18 @@ -from tests.package.test_python import TestPythonBase2, TestPythonBase3 +from tests.package.test_python import TestPythonPackageBase, TestPythonBase2, TestPythonBase3 -class TestPythonPy2Txaio(TestPythonBase2): - config = TestPythonBase2.config + \ +class TestPythonPy2Txaio(TestPythonPackageBase, TestPythonBase2): + config_package = \ """ BR2_PACKAGE_PYTHON_TXAIO=y BR2_PACKAGE_PYTHON_TWISTED=y """ + sample_scripts = ["tests/package/sample_python_txaio_twisted.py"] - def test_run(self): - self.login() - cmd = self.interpreter + " -c 'import txaio;" - cmd += "txaio.use_twisted();" - cmd += "f0 = txaio.create_future()'" - _, exit_code = self.emulator.run(cmd) - self.assertEqual(exit_code, 0) - -class TestPythonPy3Txaio(TestPythonBase3): - config = TestPythonBase3.config + \ +class TestPythonPy3Txaio(TestPythonPackageBase, TestPythonBase3): + config_package = \ """ BR2_PACKAGE_PYTHON_TXAIO=y """ - - def test_run(self): - self.login() - cmd = self.interpreter + " -c 'import txaio;" - cmd += "txaio.use_asyncio();" - cmd += "f0 = txaio.create_future()'" - _, exit_code = self.emulator.run(cmd) - self.assertEqual(exit_code, 0) + sample_scripts = ["tests/package/sample_python_txaio_asyncio.py"]