From 256fd66b46eeb849936ccbace1662fc63f917b35 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Mon, 22 Jun 2026 13:58:37 -0400 Subject: [PATCH] Add test for chunker.chunk(None) to cover guard clause --- tests/test_chunker.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/test_chunker.py b/tests/test_chunker.py index e59681a0..39003d0a 100644 --- a/tests/test_chunker.py +++ b/tests/test_chunker.py @@ -55,6 +55,13 @@ async def test_local_chunker(qa_corpus: list[dict[str, str]]): assert abs(total_tokens - original_tokens) <= original_tokens * 0.1 +@pytest.mark.asyncio +async def test_local_chunker_none_document(): + """Test DoclingLocalChunker returns empty list for None document.""" + chunker = DoclingLocalChunker() + assert await chunker.chunk(None) == [] + + @pytest.mark.asyncio async def test_local_chunker_custom_config(): """Test DoclingLocalChunker with custom configuration."""