()
| 418 | |
| 419 | |
| 420 | def test_exceptions() -> None: |
| 421 | # Check that an exception is raised when trying to convert an unsupported format |
| 422 | markitdown = MarkItDown() |
| 423 | with pytest.raises(UnsupportedFormatException): |
| 424 | markitdown.convert(os.path.join(TEST_FILES_DIR, "random.bin")) |
| 425 | |
| 426 | # Check that an exception is raised when trying to convert a file that is corrupted |
| 427 | with pytest.raises(FileConversionException) as exc_info: |
| 428 | markitdown.convert( |
| 429 | os.path.join(TEST_FILES_DIR, "random.bin"), file_extension=".pptx" |
| 430 | ) |
| 431 | assert len(exc_info.value.attempts) == 1 |
| 432 | assert type(exc_info.value.attempts[0].converter).__name__ == "PptxConverter" |
| 433 | |
| 434 | |
| 435 | @pytest.mark.skipif( |
nothing calls this directly
no test coverage detected
searching dependent graphs…