@@ -95,6 +95,7 @@ def temp_input_file(self, tmp_path: Path) -> Path:
9595 input_file .write_text ("test content" )
9696 return input_file
9797
98+ @skip_on_missing_imports (["docling" ], "rag" )
9899 def test_init_with_output_dir (self , mock_docling_imports : Any , tmp_path : Path ) -> None :
99100 """Test initialization with custom output directory."""
100101 output_dir = tmp_path / "custom_output"
@@ -104,6 +105,7 @@ def test_init_with_output_dir(self, mock_docling_imports: Any, tmp_path: Path) -
104105 assert processor .chunk_size == 1024
105106 assert output_dir .exists ()
106107
108+ @skip_on_missing_imports (["docling" ], "rag" )
107109 def test_init_without_output_dir (self , mock_docling_imports : Any ) -> None :
108110 """Test initialization without output directory (uses default)."""
109111 processor = DoclingDocumentProcessor ()
@@ -113,6 +115,7 @@ def test_init_without_output_dir(self, mock_docling_imports: Any) -> None:
113115 assert processor .chunk_size == 512
114116 assert expected_dir .exists ()
115117
118+ @skip_on_missing_imports (["docling" ], "rag" )
116119 def test_init_with_path_object (self , mock_docling_imports : Any , tmp_path : Path ) -> None :
117120 """Test initialization with Path object."""
118121 output_dir = tmp_path / "path_output"
@@ -121,6 +124,7 @@ def test_init_with_path_object(self, mock_docling_imports: Any, tmp_path: Path)
121124 assert processor .output_dir == output_dir
122125 assert output_dir .exists ()
123126
127+ @skip_on_missing_imports (["docling" ], "rag" )
124128 def test_process_document_with_custom_output_dir (
125129 self ,
126130 mock_docling_imports : Any ,
@@ -149,6 +153,7 @@ def test_process_document_with_custom_output_dir(
149153 assert result [0 ].name == "test_document.md"
150154 assert temp_output_dir .exists ()
151155
156+ @skip_on_missing_imports (["docling" ], "rag" )
152157 def test_process_document_with_default_output_dir (
153158 self , mock_docling_imports : Any , mock_docling_modules : Any , mock_handle_input : Any , temp_input_file : Path
154159 ) -> None :
@@ -172,6 +177,7 @@ def test_process_document_with_default_output_dir(
172177 assert result [0 ].name == "test_document.md"
173178 assert processor .output_dir .exists ()
174179
180+ @skip_on_missing_imports (["docling" ], "rag" )
175181 def test_chunk_document_with_default_chunk_size (self , mock_docling_imports : Any , temp_input_file : Path ) -> None :
176182 """Test chunk_document with default chunk size."""
177183 processor = DoclingDocumentProcessor ()
@@ -186,6 +192,7 @@ def test_chunk_document_with_default_chunk_size(self, mock_docling_imports: Any,
186192 assert len (chunks [0 ]) == 512
187193 assert len (chunks [1 ]) == 488
188194
195+ @skip_on_missing_imports (["docling" ], "rag" )
189196 def test_chunk_document_with_custom_chunk_size (self , mock_docling_imports : Any , temp_input_file : Path ) -> None :
190197 """Test chunk_document with custom chunk size."""
191198 processor = DoclingDocumentProcessor (chunk_size = 100 )
@@ -200,6 +207,7 @@ def test_chunk_document_with_custom_chunk_size(self, mock_docling_imports: Any,
200207 assert all (len (chunk ) == 50 for chunk in chunks [:- 1 ])
201208 assert len (chunks [- 1 ]) == 50
202209
210+ @skip_on_missing_imports (["docling" ], "rag" )
203211 def test_chunk_document_with_content_shorter_than_chunk_size (
204212 self , mock_docling_imports : Any , temp_input_file : Path
205213 ) -> None :
@@ -215,6 +223,7 @@ def test_chunk_document_with_content_shorter_than_chunk_size(
215223 assert len (chunks ) == 1
216224 assert chunks [0 ] == content
217225
226+ @skip_on_missing_imports (["docling" ], "rag" )
218227 def test_chunk_document_with_empty_file (self , mock_docling_imports : Any , temp_input_file : Path ) -> None :
219228 """Test chunk_document with empty file."""
220229 processor = DoclingDocumentProcessor ()
0 commit comments