diff --git a/tests/api_tests/test_api_module_table_recognizer.py b/tests/api_tests/test_api_module_table_recognizer.py index 99bdbab7..5a815663 100644 --- a/tests/api_tests/test_api_module_table_recognizer.py +++ b/tests/api_tests/test_api_module_table_recognizer.py @@ -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"]) diff --git a/tests/unit_tests/test_module_gost_frame_recognizer.py b/tests/unit_tests/test_module_gost_frame_recognizer.py index db2ef74f..c5aa26b4 100644 --- a/tests/unit_tests/test_module_gost_frame_recognizer.py +++ b/tests/unit_tests/test_module_gost_frame_recognizer.py @@ -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 @@ -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) -