From d429d5d399acc9921a9a86f4ae3d589d599605e4 Mon Sep 17 00:00:00 2001 From: Marcus Hoffmann Date: Mon, 12 Feb 2024 01:00:57 +0100 Subject: [PATCH] support/testing: add python-msgpack runtime test Signed-off-by: Marcus Hoffmann Signed-off-by: Arnout Vandecappelle --- .../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