Nexus / tests /test_tracker.py
abc1181's picture
REBUILD
aca03d2
Raw
History Blame Contribute Delete
475 Bytes
import pytest
from app.services.tracker import estimate_tokens
class TestTracker:
def test_estimate_tokens_empty(self):
assert estimate_tokens("") == 0
def test_estimate_tokens_short(self):
tokens = estimate_tokens("Hello world")
assert tokens > 0
assert tokens < 10
def test_estimate_tokens_long(self):
text = "word " * 100
tokens = estimate_tokens(text)
assert tokens > 50
assert tokens < 300