# ============================================================ # FILE: tests/test_chunker.py # ============================================================ # PURPOSE: # Basic tests for chunking logic. # # RUN: # pytest tests/test_chunker.py # # Even small tests help avoid breaking core RAG logic during refactoring. # ============================================================ from src.chunker import chunk_text_by_paragraphs def test_chunk_text_by_paragraphs_returns_chunks(): text = "Paragraph one.\n\nParagraph two.\n\nParagraph three." chunks = chunk_text_by_paragraphs( text=text, chunk_size=50, chunk_overlap=10, ) assert len(chunks) >= 1 assert "Paragraph one." in chunks[0] def test_chunk_text_by_paragraphs_handles_long_text(): text = "A" * 300 chunks = chunk_text_by_paragraphs( text=text, chunk_size=100, chunk_overlap=20, ) assert len(chunks) > 1