Files
stack/tests/prisma/test_flow_full.py
kert 641f366b03
Some checks failed
CI / skinny-install (aco) (push) Successful in 1m17s
CI / skinny-install (api) (push) Successful in 40s
CI / skinny-install (bcda) (push) Successful in 42s
CI / skinny-install (conf) (push) Successful in 35s
CI / skinny-install (perf) (push) Successful in 45s
CI / skinny-install (pfs) (push) Successful in 39s
CI / skinny-install (bib) (push) Successful in 33s
CI / skinny-install (bls) (push) Successful in 33s
CI / skinny-install (ccw) (push) Successful in 38s
CI / skinny-install (cli) (push) Successful in 40s
CI / skinny-install (cms) (push) Successful in 38s
CI / skinny-install (opps) (push) Successful in 44s
CI / skinny-install (rex) (push) Successful in 40s
CI / lint-test (push) Failing after 11m38s
Deploy / build-scan-report (push) Failing after 5m44s
test: deep exercising tests for iom, oig, sync, flow, llm, droplet +
purge stale host-zotero.sqlite

62 new tests that actually exercise module logic with mocked deps.
Deleted host-zotero.sqlite (stale schema causing false drift errors).
All HOST_DB refs now point at the live zotero.sqlite. Tracks #353.
2026-04-17 11:51:13 -04:00

52 lines
1.4 KiB
Python

"""Full tests for prisma.flow — PRISMA flow diagram."""
from __future__ import annotations
from prisma.flow import FlowCounts, count, mermaid, text_summary
from zot.db import Db
from zot.schema import create_db
class TestCount:
def test_empty_project(self, tmp_path):
path = str(tmp_path / "z.sqlite")
con = create_db(path)
con.close()
with Db(path) as db:
result = count(db, "nonexistent")
assert isinstance(result, FlowCounts)
class TestMermaid:
def test_generates_diagram(self):
counts = FlowCounts(
identified=100,
screened=80,
excluded_stage2=60,
excluded_stage2_reasons={"irrelevant": 40, "duplicate": 20},
full_text_assessed=20,
excluded_stage3=5,
excluded_stage3_reasons={"no_fulltext": 5},
included=15,
)
result = mermaid(counts, project="test")
assert isinstance(result, str)
assert len(result) > 10
class TestTextSummary:
def test_generates_text(self):
counts = FlowCounts(
identified=100,
screened=80,
excluded_stage2=60,
excluded_stage2_reasons={},
full_text_assessed=20,
excluded_stage3=5,
excluded_stage3_reasons={},
included=15,
)
result = text_summary(counts)
assert isinstance(result, str)
assert len(result) > 10