CoolFace
Apppublic

norasalem88/rag_assistant_devops

sourceHugging Faceupdated 7mo agoView on Hugging Face
0likes
test_retrieval.cpython-313.pyc17 linesDownload Raw Back to __pycache__
12�5�i�3��X�SSKrSSKrSSKr\RR	\RR	\RR\555r\RRS\5 SSK	J4r5Jr "SS\R5r
\S:Xa\R"5 gg)�N)�
get_retriever�retrieve_relevant_contextc�6�\rSrSr\S5rSrSrSrSr	g)�
TestRetrieval�c�"�[5Ulg)z(Load the vectorstore once for all tests.N)r�vectorstore)�clss �>D:\Devops chatbot\devops-rag-assistant\tests\test_retrieval.py�6setUpClass�TestRetrieval.setUpClass
s
��(�/���c�<�URURS5 g)z,Ensure vector store is initialized properly.z:Vector store should not be None; ensure ingestion has run.N)�assertIsNotNoner	)�selfs r�test_vectorstore_loaded�%TestRetrieval.test_vectorstore_loadeds�����T�-�-�/k�lrc	�(�UR(dURS5 SnSn[URUU/SSS9nUHNnURURRS5USURRS5S	U35 MP g7)z;Ensure chunks retrieved belong ONLY to the active document.�Vectorstore not loadedzWhat is a Kubernetes Pod?ztest_document.pdf��@��active_doc_ids�k�distance_threshold�doc_idzRetrieved chunk from z, expected N)r	�skipTestr�assertEqual�metadata�get)r�8test_query�mock_active_doc_id�docs�docs     r�#test_single_active_document_routing�1TestRetrieval.test_single_active_document_routings�������M�M�2�3�0�9101��)�����.�/��"�11���C������� � ��*�"�'����(8�(8��(B�'C�;�Oa�Nb�c�
�rc���UR(dURS5 SnSS/n[URUUSSS9nUH/nURURRS5US	5 M1 g12)z>Ensure chunks retrieved belong to one of the active documents.rzDocker vs Kubernetes?zdocker_guide.pdfz
k8s_guide.pdfrrrrz;Retrieved chunk from a document not in the active doc list.N)r	rr�assertInrr )rr!�active_docsr#r$s     r�"test_multi_active_document_routing�0TestRetrieval.test_multi_active_document_routing3sv������M�M�2�3�,�13�)�?�;��(�����&��"�14���C��M�M���� � ��*��M�
�r�N)15�__name__�16__module__�__qualname__�__firstlineno__�classmethodrrr%r*�__static_attributes__r,rrrrs$���*��*�m��:rr�__main__)�os�sys�unittest�path�dirname�abspath�__file__�BASE_DIR�insert�
src.retrievalrr�TestCaserr-�mainr,rr�<module>r@s|��	�17���7�7�?�?�2�7�7�?�?�2�7�7�?�?�8�+D�E�F��������8��B�=�H�%�%�=�~�z���M�M�O�r