Aoun-Ai / tests /test_new_features.py
MuhammadMahmoud's picture
feat: clean deployment with bug fixes and stability improvements
18b8b90
import os
import sys
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
from app.services.chat.urgency_detector import UrgencyLevel, detect_urgency
from app.services.security.pii_redaction import pii_redactor
from app.services.rag.rag_engine import rag_engine
def test_urgency_detector_critical():
level, category = detect_urgency("أنا وعيلتي في الشارع ومحتاجين مساعدة")
assert level == UrgencyLevel.CRITICAL
assert category == "homelessness"
def test_pii_redaction_masks_phone():
text = "رقمي 01012345678 والعنوان شارع النور"
redacted = pii_redactor.redact_text(text)
assert "01012345678" not in redacted
assert "[PHONE_REDACTED]" in redacted
def test_rag_search_returns_results():
results = rag_engine.search("أحتاج دعم طبي", top_k=2)
assert isinstance(results, list)