Spaces:
Running
Running
luanpoppe
commited on
Commit
·
78aaed0
1
Parent(s):
0cb12f9
refactor: removendo comentários
Browse files
_utils/gerar_documento_utils/tests/test_contextual_retriever_inside.py
CHANGED
|
@@ -70,41 +70,6 @@ lista_chunks_errados = [
|
|
| 70 |
class TestContextualRetrieverUtils:
|
| 71 |
context_retrieval_utils = ContextualRetrieverUtils()
|
| 72 |
|
| 73 |
-
# @pytest.mark.asyncio
|
| 74 |
-
# async def test_valida_retries_automaticos_do_contextual(self, monkeypatch):
|
| 75 |
-
# call_count = 0 # Track how many times the function is called
|
| 76 |
-
|
| 77 |
-
# # Define the custom side effect
|
| 78 |
-
# def custom_side_effect(response, document_ids):
|
| 79 |
-
# nonlocal call_count
|
| 80 |
-
# print(f"MOCK CALL {call_count+1} RECEIVED")
|
| 81 |
-
# if call_count < 2:
|
| 82 |
-
# call_count += 1
|
| 83 |
-
# print("MOCK RETORNADO FALSE")
|
| 84 |
-
# return False # Mocked return value for first two calls
|
| 85 |
-
# return validate_many_chunks_in_one_request(
|
| 86 |
-
# response, document_ids
|
| 87 |
-
# ) # Call the real function after two mocks
|
| 88 |
-
|
| 89 |
-
# monkeypatch.setattr(
|
| 90 |
-
# "_utils.gerar_documento_utils.contextual_retriever.validate_many_chunks_in_one_request",
|
| 91 |
-
# custom_side_effect,
|
| 92 |
-
# )
|
| 93 |
-
|
| 94 |
-
# mock_agpt_answer = AsyncMock(
|
| 95 |
-
# return_value=lista_respostas_contextuals_cenario_02[0]
|
| 96 |
-
# )
|
| 97 |
-
# monkeypatch.setattr(
|
| 98 |
-
# "_utils.gerar_documento_utils.contextual_retriever.agpt_answer",
|
| 99 |
-
# mock_agpt_answer,
|
| 100 |
-
# )
|
| 101 |
-
|
| 102 |
-
# resultado = await self.context_retrieval.llm_call_uma_lista_de_20_chunks(
|
| 103 |
-
# cenario_01_lista_com_20_chunks, cenario_01_resumo_auxiliar
|
| 104 |
-
# )
|
| 105 |
-
# assert all(len(item) == 3 for item in resultado)
|
| 106 |
-
# assert call_count == 2 # Ensure only the first two calls were mocked
|
| 107 |
-
|
| 108 |
@pytest.mark.asyncio
|
| 109 |
def test_check_regex_patterns_success(self):
|
| 110 |
for context in resposta_llm_com_20_chunks_fixture_array:
|
|
|
|
| 70 |
class TestContextualRetrieverUtils:
|
| 71 |
context_retrieval_utils = ContextualRetrieverUtils()
|
| 72 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 73 |
@pytest.mark.asyncio
|
| 74 |
def test_check_regex_patterns_success(self):
|
| 75 |
for context in resposta_llm_com_20_chunks_fixture_array:
|