File size: 803 Bytes
76d67c5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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()