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
46 lines
1.2 KiB
Python
46 lines
1.2 KiB
Python
"""Deep tests for bib.pincite."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from unittest.mock import MagicMock
|
|
|
|
from bib.pincite import Pincite, _classify_locator, parse_pincites, upsert_pincites
|
|
|
|
|
|
class TestClassifyLocator:
|
|
def test_page(self):
|
|
result = _classify_locator("p.14")
|
|
assert isinstance(result, str)
|
|
|
|
def test_section(self):
|
|
result = _classify_locator("§2.2.1")
|
|
assert isinstance(result, str)
|
|
|
|
def test_empty(self):
|
|
result = _classify_locator("")
|
|
assert isinstance(result, str)
|
|
|
|
|
|
class TestParsePincites:
|
|
def test_basic(self):
|
|
doc = ':pincite:`KEY12345` — "Some quoted text"'
|
|
result = parse_pincites(doc, "test.py")
|
|
assert isinstance(result, list)
|
|
|
|
def test_no_match(self):
|
|
result = parse_pincites("no pincites here", "test.py")
|
|
assert result == []
|
|
|
|
|
|
class TestUpsertPincites:
|
|
def test_upserts(self):
|
|
store = MagicMock()
|
|
store.upsert_pincite.return_value = 1
|
|
pincites = [
|
|
Pincite(
|
|
fn_path="src/test.py", item_key="KEY12345", text="Quote", locator="p.5"
|
|
),
|
|
]
|
|
result = upsert_pincites(store, pincites)
|
|
assert isinstance(result, int)
|