Files
willemjanandClaude Sonnet 5 3ef9a7666a add reporting foundation: multipage nav, auth gate, date-range fetch
First increment of the clinical reporting feature (see
docs/requirements-reporting.md and docs/design-reporting.md): moves the
existing live view to pages/1_Live.py, adds a password gate since the
dashboard URL will be shared with the diabetes team, adds
fetch_entries_range/fetch_treatments_range for multi-day report queries,
and adds reporting.py with the core clinical calculations (GMI, %CV,
5-band time-in-range, hypo/hyper event detection per the Battelino et al.
2019 persistence rule). No report pages wired up yet — that's next.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
2026-07-26 20:00:48 +02:00

18 lines
514 B
Python

import hashlib
from auth import verify_password
def test_verify_password_accepts_matching_hash():
expected = hashlib.sha256(b"correct-horse").hexdigest()
assert verify_password("correct-horse", expected) is True
def test_verify_password_rejects_wrong_password():
expected = hashlib.sha256(b"correct-horse").hexdigest()
assert verify_password("wrong-password", expected) is False
def test_verify_password_rejects_when_no_hash_configured():
assert verify_password("anything", "") is False