File size: 535 Bytes
679c60d
 
a5f24dc
 
 
 
679c60d
 
a5f24dc
679c60d
a5f24dc
 
679c60d
a5f24dc
679c60d
 
a5f24dc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from app import rag_bot

def test_rag_bot():
    # Use a sample small PDF (must exist in repo for testing)
    sample_pdf = "manual.pdf"  # Replace with a small test PDF
    question = "What is the purpose of this document?"

    try:
        answer = rag_bot(question, sample_pdf)
        assert isinstance(answer, str)
        print("✅ Test Passed: Bot returned an answer")
        print("Sample Answer:", answer[:200])
    except Exception as e:
        print("❌ Test Failed:", e)

if __name__ == "__main__":
    test_rag_bot()