File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -232,3 +232,33 @@ def test_pdf_converted(self) -> None:
232232 ),
233233 ]
234234 self .mock_popen .assert_has_calls (expected_calls )
235+
236+ def test_rtf_converted (self ) -> None :
237+ with mock .patch (
238+ "cardinal_pythonlib.extract_text.UNRTF_SUPPORTS_QUIET" , True
239+ ):
240+ with mock .patch .multiple (
241+ "cardinal_pythonlib.extract_text.subprocess" ,
242+ Popen = self .mock_popen ,
243+ ):
244+ with NamedTemporaryFile (
245+ suffix = ".rtf" , delete = False
246+ ) as temp_file :
247+ temp_file .close ()
248+ document_to_text (
249+ filename = temp_file .name , config = self .config
250+ )
251+
252+ expected_calls = [
253+ mock .call (
254+ (
255+ f"{ self .empty_dir } /unrtf" ,
256+ "--text" ,
257+ "--nopict" ,
258+ "--quiet" ,
259+ temp_file .name ,
260+ ),
261+ stdout = subprocess .PIPE ,
262+ ),
263+ ]
264+ self .mock_popen .assert_has_calls (expected_calls )
You can’t perform that action at this time.
0 commit comments