Waystar Charge Billed Report bot. Reads CMS-1500 claim PDFs from the text layer (src/cms1500_text.py) instead of Google Document AI. Dependencies managed with uv (Python 3.12). Secrets, PHI and build output are git-ignored. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
19 lines
772 B
Python
19 lines
772 B
Python
"""The --selftest switch must check the build without touching Chrome or Waystar."""
|
|
import ChargeBilledAutomation as bot
|
|
|
|
|
|
def test_selftest_without_pdfs_passes_and_says_so(capsys):
|
|
assert bot.self_test([]) == 0
|
|
assert "SELFTEST OK" in capsys.readouterr().out
|
|
|
|
|
|
def test_selftest_fails_for_unreadable_pdf(capsys, tmp_path):
|
|
assert bot.self_test([str(tmp_path / "missing.pdf")]) == 1
|
|
assert "SELFTEST FAILED" in capsys.readouterr().out
|
|
|
|
|
|
def test_selftest_never_starts_chrome(monkeypatch):
|
|
monkeypatch.setattr(bot, "kill_all_chrome", lambda: (_ for _ in ()).throw(AssertionError("Chrome touched")))
|
|
monkeypatch.setattr(bot, "start_chrome_debug", lambda *a: (_ for _ in ()).throw(AssertionError("Chrome touched")))
|
|
assert bot.self_test([]) == 0
|