personal-finance-database/tests/test_data_ingestion.py

17 lines
463 B
Python
Raw Normal View History

2023-06-25 15:50:17 +00:00
import pytest
from pdf_parser import PdfParser
def test_pdf_parser_text_extraction():
pdf_parser = PdfParser('path_to_test_pdf')
text = pdf_parser.extract_text()
assert isinstance(text, str)
assert len(text) > 0
def test_pdf_parser_table_extraction():
pdf_parser = PdfParser('path_to_test_pdf')
tables = pdf_parser.extract_table()
assert isinstance(tables, list)
assert all(isinstance(table, pd.DataFrame) for table in tables)