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]>
18 lines
514 B
Python
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
|