mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-08-08 08:30:47 -09:00
support/testing: python-pydal: new runtime test
Signed-off-by: Julien Olivain <ju.o@free.fr>
This commit is contained in:
@@ -1857,6 +1857,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
|
||||
@@ -2012,6 +2013,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
|
||||
|
||||
11
support/testing/tests/package/sample_python_pydal.py
Normal file
11
support/testing/tests/package/sample_python_pydal.py
Normal 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()
|
||||
12
support/testing/tests/package/test_python_pydal.py
Normal file
12
support/testing/tests/package/test_python_pydal.py
Normal 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"]
|
||||
Reference in New Issue
Block a user