Further refactoring of book_handler logic into PDFParser

Also deletes the unnencessary abogen/book_handler and just use pyqt/book_hanlder
This commit is contained in:
Mohan Krishnan
2026-01-09 08:44:33 +08:00
parent 5ae153f841
commit eb7d135bc3
6 changed files with 261 additions and 1784 deletions
+3 -2
View File
@@ -175,10 +175,11 @@ class TestBookParser(unittest.TestCase):
"""Test get_chapters returns correct list for different parsers."""
# PDF
parser_pdf = get_book_parser(self.sample_pdf_path)
parser_pdf.process_content()
chapters = parser_pdf.get_chapters()
self.assertEqual(len(chapters), 2)
self.assertEqual(chapters[0], ("page_1", "Page 1"))
self.assertEqual(chapters[0], ("page_1", "Page 1 - Page 1 content"))
# MD
parser_md = get_book_parser(self.sample_md_path)
parser_md.process_content() # Must process to get structure