[Buildroot] [PATCH] support/testing: add python-msgpack runtime test

Marcus Hoffmann buildroot at bubu1.eu
Mon Feb 12 00:00:57 UTC 2024


Signed-off-by: Marcus Hoffmann <buildroot at bubu1.eu>
---
 .../testing/tests/package/sample_python_msgpack.py   |  5 +++++
 support/testing/tests/package/test_python_msgpack.py | 12 ++++++++++++
 2 files changed, 17 insertions(+)
 create mode 100644 support/testing/tests/package/sample_python_msgpack.py
 create mode 100644 support/testing/tests/package/test_python_msgpack.py

diff --git a/support/testing/tests/package/sample_python_msgpack.py b/support/testing/tests/package/sample_python_msgpack.py
new file mode 100644
index 0000000000..1940f70821
--- /dev/null
+++ b/support/testing/tests/package/sample_python_msgpack.py
@@ -0,0 +1,5 @@
+import msgpack
+
+packaed = msgpack.packb([1, 2, 3], use_bin_type=True)
+
+assert msgpack.unpackb(packaed, raw=False) == [1, 2, 3]
diff --git a/support/testing/tests/package/test_python_msgpack.py b/support/testing/tests/package/test_python_msgpack.py
new file mode 100644
index 0000000000..e5876e400d
--- /dev/null
+++ b/support/testing/tests/package/test_python_msgpack.py
@@ -0,0 +1,12 @@
+from tests.package.test_python import TestPythonPackageBase
+
+
+class TestPythonPy3MsgPack(TestPythonPackageBase):
+    __test__ = True
+    config = TestPythonPackageBase.config + \
+        """
+        BR2_PACKAGE_PYTHON3=y
+        BR2_PACKAGE_PYTHON_MSGPACK=y
+        """
+    sample_scripts = ["tests/package/sample_python_msgpack.py"]
+    timeout = 40
-- 
2.43.0




More information about the buildroot mailing list