|
|
from utils import convert_doc_to_markdown |
|
|
import os |
|
|
|
|
|
def test_conversion(): |
|
|
|
|
|
|
|
|
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.") |
|
|
|
|
|
|
|
|
os.remove(dummy_file) |
|
|
|
|
|
if __name__ == "__main__": |
|
|
test_conversion() |
|
|
|