From dfa0c8e3a876af16a0b57e49683c5f420c23678d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20M=C3=A9lotte?= Date: Tue, 14 Jun 2022 18:47:53 +0200 Subject: [PATCH] support/testing: add new test for python-jmespath MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a new rudimentary test inspired by the examples from jmespath's README file ([1]). [1]: https://github.com/jmespath/jmespath.py/blob/develop/README.rst Signed-off-by: Raphaël Mélotte [Thomas: add entry in DEVELOPERS file] Signed-off-by: Thomas Petazzoni --- DEVELOPERS | 2 ++ .../testing/tests/package/sample_python_jmespath.py | 4 ++++ .../testing/tests/package/test_python_jmespath.py | 12 ++++++++++++ 3 files changed, 18 insertions(+) create mode 100644 support/testing/tests/package/sample_python_jmespath.py create mode 100644 support/testing/tests/package/test_python_jmespath.py diff --git a/DEVELOPERS b/DEVELOPERS index 55406892c7..54eb08c1d6 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -2435,8 +2435,10 @@ F: package/python-jmespath/ F: package/python-pymupdf/ F: package/python-rsa/ F: package/python-s3transfer/ +F: support/testing/tests/package/sample_python_jmespath.py F: support/testing/tests/package/sample_python_rsa.py F: support/testing/tests/package/sample_python_s3transfer.py +F: support/testing/tests/package/test_python_jmespath.py F: support/testing/tests/package/test_python_rsa.py F: support/testing/tests/package/test_python_s3transfer.py diff --git a/support/testing/tests/package/sample_python_jmespath.py b/support/testing/tests/package/sample_python_jmespath.py new file mode 100644 index 0000000000..aefccd4fd8 --- /dev/null +++ b/support/testing/tests/package/sample_python_jmespath.py @@ -0,0 +1,4 @@ +import jmespath +expression = jmespath.compile('foo.bar') +res = expression.search({'foo': {'bar': 'baz'}}) +assert res == "baz", "expression.search failed" diff --git a/support/testing/tests/package/test_python_jmespath.py b/support/testing/tests/package/test_python_jmespath.py new file mode 100644 index 0000000000..80fd09fdde --- /dev/null +++ b/support/testing/tests/package/test_python_jmespath.py @@ -0,0 +1,12 @@ +from tests.package.test_python import TestPythonPackageBase + + +class TestPythonPy3Jmespath(TestPythonPackageBase): + __test__ = True + config = TestPythonPackageBase.config + \ + """ + BR2_PACKAGE_PYTHON3=y + BR2_PACKAGE_PYTHON_JMESPATH=y + """ + sample_scripts = ["tests/package/sample_python_jmespath.py"] + timeout = 10