support/testing: python-pydal: new runtime test

Signed-off-by: Julien Olivain <ju.o@free.fr>
(cherry picked from commit 67d6e6602f)
Signed-off-by: Titouan Christophe <titouan.christophe@mind.be>
This commit is contained in:
Julien Olivain
2026-07-26 11:27:11 +02:00
committed by Titouan Christophe
parent c507205a67
commit a96a106369
3 changed files with 25 additions and 0 deletions

View File

@@ -1845,6 +1845,7 @@ F: support/testing/tests/package/sample_python_midiutil.py
F: support/testing/tests/package/sample_python_ml_dtypes.py
F: support/testing/tests/package/sample_python_mpmath.py
F: support/testing/tests/package/sample_python_pyalsa.py
F: support/testing/tests/package/sample_python_pydal.py
F: support/testing/tests/package/sample_python_spake2.py
F: support/testing/tests/package/sample_python_sympy.py
F: support/testing/tests/package/test_4th.py
@@ -2000,6 +2001,7 @@ F: support/testing/tests/package/test_python_midiutil.py
F: support/testing/tests/package/test_python_ml_dtypes.py
F: support/testing/tests/package/test_python_mpmath.py
F: support/testing/tests/package/test_python_pyalsa.py
F: support/testing/tests/package/test_python_pydal.py
F: support/testing/tests/package/test_python_pyqt5.py
F: support/testing/tests/package/test_python_pyqt5/
F: support/testing/tests/package/test_python_spake2.py

View File

@@ -0,0 +1,11 @@
# From:
# https://github.com/web2py/pydal/tree/v20260313.1#usage-and-documentation
from pydal import DAL, Field
db = DAL('sqlite://storage.db')
db.define_table('thing', Field('name'))
db.thing.insert(name='Chair')
query = db.thing.name.startswith('C')
rows = db(query).select()
print(rows[0].name)
assert rows[0].name == "Chair"
db.commit()

View File

@@ -0,0 +1,12 @@
from tests.package.test_python import TestPythonPackageBase
class TestPythonPy3PyDAL(TestPythonPackageBase):
__test__ = True
config = TestPythonPackageBase.config + \
"""
BR2_PACKAGE_PYTHON3=y
BR2_PACKAGE_PYTHON3_SQLITE=y
BR2_PACKAGE_PYTHON_PYDAL=y
"""
sample_scripts = ["tests/package/sample_python_pydal.py"]