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()