mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-09-10 00:04:06 -09:00
support/testing: python-pydal: new runtime test
Signed-off-by: Julien Olivain <ju.o@free.fr>
This commit is contained in:
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()
|
||||
Reference in New Issue
Block a user