From 5562eb58e8bad82bf8d691f90e6411344e280847 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20M=C3=A9lotte?= Date: Sun, 24 Oct 2021 20:12:19 +0200 Subject: [PATCH] support/testing: add new test for python-boto3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a rudimentary test inspired from the "Using boto3" section in the package README ([1]). Note that it doesn't try to do anything with the instanciated resource, as this would require a network connection when the test runs. [1]: https://github.com/boto/boto3 Signed-off-by: Raphaël Mélotte Signed-off-by: Arnout Vandecappelle (Essensium/Mind) --- support/testing/tests/package/sample_python_boto3.py | 2 ++ support/testing/tests/package/test_python_boto3.py | 12 ++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 support/testing/tests/package/sample_python_boto3.py create mode 100644 support/testing/tests/package/test_python_boto3.py diff --git a/support/testing/tests/package/sample_python_boto3.py b/support/testing/tests/package/sample_python_boto3.py new file mode 100644 index 0000000000..e69efc7860 --- /dev/null +++ b/support/testing/tests/package/sample_python_boto3.py @@ -0,0 +1,2 @@ +import boto3 +s3 = boto3.resource('s3') diff --git a/support/testing/tests/package/test_python_boto3.py b/support/testing/tests/package/test_python_boto3.py new file mode 100644 index 0000000000..756495fec9 --- /dev/null +++ b/support/testing/tests/package/test_python_boto3.py @@ -0,0 +1,12 @@ +from tests.package.test_python import TestPythonPackageBase + + +class TestPythonPy3Boto3(TestPythonPackageBase): + __test__ = True + config = TestPythonPackageBase.config + \ + """ + BR2_PACKAGE_PYTHON3=y + BR2_PACKAGE_PYTHON_BOTO3=y + """ + sample_scripts = ["tests/package/sample_python_boto3.py"] + timeout = 10