Spaces:
Sleeping
Sleeping
| from utils import convert_doc_to_markdown | |
| import os | |
| def test_conversion(): | |
| # Create a dummy text file to test conversion (since we don't have a PDF handy easily without downloading) | |
| # MarkItDown handles text files too. | |
| dummy_file = "test_doc.txt" | |
| with open(dummy_file, "w") as f: | |
| f.write("This is a test document for claims processing.\nRepair estimate: £500.\n") | |
| print(f"Testing conversion of {dummy_file}...") | |
| content = convert_doc_to_markdown(dummy_file) | |
| print("Converted Content:") | |
| print(content) | |
| if "Repair estimate: £500" in content: | |
| print("SUCCESS: Content extracted correctly.") | |
| else: | |
| print("FAILURE: Content not extracted.") | |
| # Clean up | |
| os.remove(dummy_file) | |
| if __name__ == "__main__": | |
| test_conversion() | |