Fix Zotero table models for Zotero 9:
- Remove stale Annotations/Highlights/Transaction* models
- Add ItemAnnotations, RetractedItems, DeletedCollections,
DeletedSearches, DbDebug1
- Fix ItemAttachments, Libraries, Users column mismatches
New test files covering all major modules:
- cli/{bib,prisma,rec,zot,mail,run} deep exercising tests
- mail/{droplet,postmark,resend,cloudflare} lifecycle tests
- bib/{iom,oig,pincite,sync,regulations_gov,email_ingest,format,store}
- prisma/{vpn,fetch,export,llm,screen,eligibility,extract,project,ingest,flow}
- aco/lake/{unity,quality,deploy} + api/aco coverage gaps
- zot/{ops,db,extract,duck} + rec/{report,engine,base,pricers}
- pfs/{pipe,rules,eq,files}
Add pytest-xdist for parallel test execution.
Tracks #353
38 lines
1.2 KiB
Python
38 lines
1.2 KiB
Python
"""Exercise prisma.export with real DB."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from prisma.export import load_item, to_markdown
|
|
from zot.db import TYPE_MAP, Db
|
|
from zot.schema import create_db
|
|
|
|
|
|
class TestLoadItemFromDb:
|
|
def test_loads_item(self, tmp_path):
|
|
path = str(tmp_path / "z.sqlite")
|
|
con = create_db(path)
|
|
con.close()
|
|
with Db(path) as db:
|
|
iid = db.create_item(TYPE_MAP["document"])
|
|
db.set_fields(iid, {"title": "Test Doc", "url": "https://x.com"})
|
|
db.sync_tags(iid, ["module:test"])
|
|
db.commit()
|
|
snap = load_item(db, iid, tmp_path / "storage")
|
|
assert snap.title == "Test Doc"
|
|
assert "module:test" in snap.tags
|
|
|
|
|
|
class TestToMarkdown:
|
|
def test_renders(self, tmp_path):
|
|
path = str(tmp_path / "z.sqlite")
|
|
con = create_db(path)
|
|
con.close()
|
|
with Db(path) as db:
|
|
iid = db.create_item(TYPE_MAP["document"])
|
|
db.set_fields(iid, {"title": "Test", "abstractNote": "Abstract here."})
|
|
db.commit()
|
|
snap = load_item(db, iid, tmp_path / "storage")
|
|
md = to_markdown(snap)
|
|
assert "Test" in md
|
|
assert "Abstract" in md
|