26 lines
664 B
Python
26 lines
664 B
Python
import pytest
|
|
import sys
|
|
import os
|
|
from unittest.mock import MagicMock
|
|
|
|
# Ensure project root is in path
|
|
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
|
|
|
|
import ai_client
|
|
|
|
def test_get_history_bleed_stats_basic():
|
|
# Reset state
|
|
ai_client.reset_session()
|
|
|
|
# Mock some history
|
|
ai_client.history_trunc_limit = 1000
|
|
# Simulate 500 tokens used
|
|
with MagicMock() as mock_stats:
|
|
# This would usually involve patching the encoder or session logic
|
|
pass
|
|
|
|
stats = ai_client.get_history_bleed_stats()
|
|
assert 'current' in stats
|
|
assert 'limit' in stats
|
|
assert stats['limit'] == 1000
|