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