File size: 1,174 Bytes
39fc36b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import pytest
from _utils.bubble_integrations.obter_arquivo import get_pdf_from_bubble
from langchain_core.documents import Document

pdf_file_url = "https://vella.app.br/version-test/fileupload/f1736298232170x993758712541722200/0002269-86.2009.8.05.0032%20processo%20teste.pdf"


class TestObterArquivo:
    @pytest.mark.asyncio
    async def test_get_pdf_from_bubble_No_llama_parse(self):
        should_use_llama_parse = False
        result = await get_pdf_from_bubble(pdf_file_url, should_use_llama_parse)

        assert isinstance(result, list)
        assert len(result) > 0
        print("\n\nresult", result)
        assert all(isinstance(item, Document) for item in result)

    # Teste abaixo não funciona com arquivos grandes -> O Llama Parse dá erro de timeout
    # @pytest.mark.asyncio
    # async def test_get_pdf_from_bubble_With_llama_parse(self):
    #     should_use_llama_parse = True
    #     result = await get_pdf_from_bubble(pdf_file_url, should_use_llama_parse)

    #     assert isinstance(result, list)
    #     assert len(result) > 0
    #     print("\n\nresult", result)
    #     assert all(isinstance(item, Document) for item in result)