mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-08-06 23:53:50 -09:00
Add a basic runtime test for the python-cloudpickle package. This test verifies the fundamental serialization capabilities of the library by: - Importing `cloudpickle`. - Defining a simple Python function (fibonacci). - Using `cloudpickle.dumps()` to serialize this function. Signed-off-by: Xukai Wang <kingxukai@zohomail.com> [Julien: fix flake8 warnings to fix check-package errors] Signed-off-by: Julien Olivain <ju.o@free.fr>
9 lines
142 B
Python
9 lines
142 B
Python
import cloudpickle
|
|
|
|
|
|
def fibonacci(n):
|
|
return n if n < 2 else fibonacci(n-1) + fibonacci(n-2)
|
|
|
|
|
|
serialized = cloudpickle.dumps(fibonacci)
|