All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] support/testing: add new test for python-jmespath
@ 2022-06-14 16:47 Raphaël Mélotte
  2022-06-14 16:47 ` [Buildroot] [PATCH 2/2] package/python-jmespath: bump to version 1.0.0 Raphaël Mélotte
  2022-07-22 21:22 ` [Buildroot] [PATCH 1/2] support/testing: add new test for python-jmespath Thomas Petazzoni via buildroot
  0 siblings, 2 replies; 3+ messages in thread
From: Raphaël Mélotte @ 2022-06-14 16:47 UTC (permalink / raw)
  To: buildroot; +Cc: Raphaël Mélotte, Ricardo Martincoski

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 <raphael.melotte@mind.be>
---
 .../testing/tests/package/sample_python_jmespath.py  |  4 ++++
 .../testing/tests/package/test_python_jmespath.py    | 12 ++++++++++++
 2 files changed, 16 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/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
-- 
2.35.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-07-22 21:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-14 16:47 [Buildroot] [PATCH 1/2] support/testing: add new test for python-jmespath Raphaël Mélotte
2022-06-14 16:47 ` [Buildroot] [PATCH 2/2] package/python-jmespath: bump to version 1.0.0 Raphaël Mélotte
2022-07-22 21:22 ` [Buildroot] [PATCH 1/2] support/testing: add new test for python-jmespath Thomas Petazzoni via buildroot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.