arc/hesabixAPI/tests/test_ai_memory_structured.py

26 lines
892 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

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.

"""تست‌های باقی‌ماندهٔ ماژول structured — فقط برای سازگاری import در صورت نیاز."""
from __future__ import annotations
import pytest
def test_structured_module_still_importable_but_unused():
"""فیلدهای ساخت‌یافته از جریان اصلی حافظه حذف شدند."""
from app.services.ai import ai_memory_structured as mod
assert hasattr(mod, "parse_structured")
s = mod.parse_structured(None)
assert isinstance(s, dict)
@pytest.mark.parametrize(
"text,expect_key",
[
("هدف فروش ماهانه ۵۰۰ میلیون تومان", "sales_goal_monthly"),
],
)
def test_legacy_extract_still_works(text, expect_key):
from app.services.ai.ai_memory_structured import extract_structured_from_text
patch = extract_structured_from_text(text)
assert expect_key in patch