grantforge-api / backend /tests /test_safe_mode.py
GrantForge Bot
Deploy sha-9a5957fcdef15b7e2623f8b147cda6026475aee0 — source build (no GHCR)
3a3734f
Raw
History Blame Contribute Delete
524 Bytes
from core.safe_mode import (
SAFE_MODE_MARKER,
SAFE_MODE_GENERATOR_RULE,
count_safe_mode_markers,
safe_mode_active,
)
def test_marker_constant():
assert "BRAK DANYCH" in SAFE_MODE_MARKER
assert SAFE_MODE_MARKER in SAFE_MODE_GENERATOR_RULE
def test_count_markers():
text = f"Kwota: {SAFE_MODE_MARKER} i adres {SAFE_MODE_MARKER}"
assert count_safe_mode_markers(text) == 2
def test_safe_mode_active():
assert safe_mode_active(["gap1"]) is True
assert safe_mode_active([]) is False