Watch
1
0
Fork
You've already forked Seyyed_arc
0
forked from hesabix/arc
Seyyed_arc/hesabixAPI/tests/test_ai_premature_answer.py
2026-07-16 17:36:58 +00:00

42 lines
1.5 KiB
Python
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"""تست تشخیص narrative وضعیت — فقط برای eval/logging (Phase 3)."""
from __future__ import annotations
from app.services.ai.ai_premature_answer import looks_like_status_narrative
def test_detects_persian_status_in_progress():
assert looks_like_status_narrative(
"در حال دریافت لیست گزارش‌های موجود برای شناسایی گزارش هزینه‌ها هستم."
)
def test_detects_english_will_call():
assert looks_like_status_narrative(
"We will call resolve_date_range then get_financial_summary."
)
def test_detects_date_range_intent_announcement():
assert looks_like_status_narrative(
"در حال محاسبه بازهٔ تاریخ «۳ ماه گذشته» بر حسب تقویم جلالی است. "
"برای این کار ابتدا تابع resolve_date_range را صدا می‌زنیم."
)
def test_real_answer_not_flagged():
assert not looks_like_status_narrative(
"**خلاصه سود و زیان ۳ ماه گذشته**\n\n"
"| شاخص | مقدار |\n|------|-------|\n"
"| درآمد کل | ‎1 221 161 500 ریال |"
)
def test_greeting_not_flagged():
assert not looks_like_status_narrative(
"سلام! چه کمکی از اطلاعات حسابیکس می‌توانم براتون انجام بدم؟"
)
def test_empty_not_flagged():
assert not looks_like_status_narrative("")
assert not looks_like_status_narrative(" ")