Files
social-app/backend/tests/integration/test_agent_chat_session_persistence.py
T

21 lines
538 B
Python

from __future__ import annotations
from decimal import Decimal
from v1.agent_chat.service import aggregate_session_cost
def test_aggregate_session_cost_sums_non_negative_values() -> None:
total = aggregate_session_cost([Decimal("0.010000"), Decimal("0.002500")])
assert total == Decimal("0.012500")
def test_aggregate_session_cost_rejects_negative_value() -> None:
try:
aggregate_session_cost([Decimal("-0.010000")])
raised = False
except ValueError:
raised = True
assert raised is True