From f6b3252088284c86bd263f20a47c18868fb45493 Mon Sep 17 00:00:00 2001 From: Ari Sosnovsky Date: Mon, 2 Nov 2020 13:23:27 -0500 Subject: [PATCH] counting number of pages and added a warning --- tests/test_document.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/test_document.py b/tests/test_document.py index 5c05408..3e076e4 100644 --- a/tests/test_document.py +++ b/tests/test_document.py @@ -134,10 +134,15 @@ class ParsingState(TestCase): self.assertEqual(len(parser.health_report), 0) get_info(parser) list(iter_all_page_leafs(parser, catalog.pages)) + parser = PDFDocument(buffer) + actual_pages = len(list(parser.iter_pages())) + self.assertEqual(actual_pages, parser.num_pages) def test_doc(self): with all_pdf_files["bad-unicode.pdf"].get_window() as buffer: parser = PDFDocument(buffer) + actual_pages = len(list(parser.iter_pages())) + self.assertEqual(actual_pages, parser.num_pages) class Structures(TestCase):