Changeset 3389960 in flexoentity for tests/test_sqlite_backend.py
- Timestamp:
- 02/27/26 13:47:23 (3 days ago)
- Branches:
- unify_backends
- Children:
- c1144fd
- Parents:
- 54941b4
- File:
-
- 1 edited
-
tests/test_sqlite_backend.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tests/test_sqlite_backend.py
r54941b4 r3389960 4 4 5 5 6 def make_domain(domain_id="PY_ARITHM"): 7 return Domain.with_domain_id( 8 subtype="Domain", 9 domain_id=domain_id, 10 fullname="PYTHON_ARITHMETIC", 11 description="ALL ABOUT ARITHMETIC IN PYTHON", 12 classification="UNCLASSIFIED", 13 ) 14 15 16 def test_sqlite_roundtrip(tmp_path): 6 def test_sqlite_roundtrip(tmp_path, sample_domain): 17 7 db_path = tmp_path / "domains.db" 18 8 conn = sqlite3.connect(db_path) … … 21 11 backend = SQLiteEntityBackend(Domain, conn, table_name="domains") 22 12 23 dom = make_domain() 24 backend.save(dom) 13 backend.save(sample_domain.to_dict()) 25 14 26 loaded = backend.load( dom.flexo_id)27 assert loaded .to_dict() == dom.to_dict()15 loaded = backend.load(sample_domain.flexo_id) 16 assert loaded == sample_domain.to_dict() 28 17 29 18 all_loaded = backend.load_all() 30 19 assert len(all_loaded) == 1 31 assert all_loaded[0].domain_id == "PY_ARITHM"20 assert Domain.from_dict(all_loaded[0]).domain_id == "PY_ARITHM"
Note:
See TracChangeset
for help on using the changeset viewer.
