Update simple tests
Committed c4c8c0
--- a/test_sqlyte.py
+++ b/test_sqlyte.py
pathlib.Path("_test_data").mkdir()
-def test_json():
- db = sqlyte.db("_test_data/1.db", sqlyte.Model("test", testing={"name": "TEXT"}))
+def test_simple_usage():
+ db = sqlyte.db("_test_data/1.db", sqlyte.Model("TestDB", testing={"name": "TEXT"}))
+ assert len(db.columns("testing")) == 1
db.insert("testing", name="foo")
db.insert("testing", name="bar")
+ assert len(db.select("testing")) == 2
+ db.update("testing", name="bat", where="name = ?", vals=["bar"])
+ db.delete("testing", where="name = ?", vals=["bat"])
+ assert len(db.select("testing")) == 1
-def test_transaction():
+def test_transactions():
db = sqlyte.db("_test_data/2.db", sqlyte.Model("test", testing={"name": "TEXT"}))
with db.conn:
cursor = sqlyte.Cursor(db.conn.cursor())