Skip to content

Commit

Permalink
style fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Golodkov committed Sep 11, 2024
1 parent 9744f54 commit 03dbf9e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
14 changes: 7 additions & 7 deletions tests/api_tests/test_api_module_table_recognizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,12 @@ def test_detect_small_table(self) -> None:
tables = result["content"]["tables"]
self.assertEqual(2, len(tables))

def test_multipage_gost_table(self):
def test_multipage_gost_table(self) -> None:
file_name = "gost_multipage_table.pdf"
result = self._send_request(file_name, data={"need_gost_frame_analysis": "True"}) # don't pass pdf_with_text_layer to check condition in PDFBaseReader
self.assertTrue(len(result['content']['tables'][0]['cells']) > 35)
self.assertTrue('KR13' in result['content']['tables'][0]['cells'][-1][0]['lines'][0]['text']) # check the last row of multipage table
self.assertTrue('R13.1' in result['content']['tables'][0]['cells'][-1][1]['lines'][0]['text']) # check that it belongs to first and only table
self.assertTrue('Испытание по проверке' in result['content']['tables'][0]['cells'][-1][2]['lines'][0]['text'])
self.assertTrue('3.6' in result['content']['tables'][0]['cells'][-1][3]['lines'][0]['text'])
self.assertTrue('7.4.9' in result['content']['tables'][0]['cells'][-1][4]['lines'][0]['text'])
self.assertTrue(len(result["content"]["tables"][0]["cells"]) > 35)
self.assertTrue("KR13" in result["content"]["tables"][0]["cells"][-1][0]["lines"][0]["text"]) # check the last row of multipage table
self.assertTrue("R13.1" in result["content"]["tables"][0]["cells"][-1][1]["lines"][0]["text"]) # check that it belongs to first and only table
self.assertTrue("Испытание по проверке" in result["content"]["tables"][0]["cells"][-1][2]["lines"][0]["text"])
self.assertTrue("3.6" in result["content"]["tables"][0]["cells"][-1][3]["lines"][0]["text"])
self.assertTrue("7.4.9" in result["content"]["tables"][0]["cells"][-1][4]["lines"][0]["text"])
3 changes: 1 addition & 2 deletions tests/unit_tests/test_module_gost_frame_recognizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
import numpy as np

import dedoc.utils.parameter_utils as param_utils
from dedoc.readers.pdf_reader.pdf_auto_reader.pdf_auto_reader import PdfAutoReader
from dedoc.readers.pdf_reader.pdf_base_reader import ParametersForParseDoc
from dedoc.readers.pdf_reader.pdf_image_reader.pdf_image_reader import PdfImageReader
from dedoc.readers.pdf_reader.pdf_auto_reader.pdf_auto_reader import PdfAutoReader
from dedoc.readers.pdf_reader.pdf_image_reader.table_recognizer.gost_frame_recognizer import GOSTFrameRecognizer
from tests.test_utils import get_test_config

Expand Down Expand Up @@ -86,4 +86,3 @@ def test_pdf_auto_reader(self) -> None:
self.assertEqual(result.tables[0].cells[0][2].get_text(), "Колонка 3")
self.assertEqual(len(result.tables[0].cells), 22)
self.assertTrue("Названне таблицы (продолженне)" in result.lines[0].line)

0 comments on commit 03dbf9e

Please sign in to comment.