def test_replace_page_at_end(self): total_pages = pypdftk.get_num_pages(TEST_PDF_PATH) last_page = pypdftk.get_num_pages(TEST_PDF_PATH) pdf_to_insert = 'test_files/page_01.pdf' pypdftk.replace_page(TEST_PDF_PATH, last_page, pdf_to_insert) self.assertEqual(total_pages, pypdftk.get_num_pages(TEST_PDF_PATH))
def test_replace_page_at_middle(self): total_pages = pypdftk.get_num_pages(TEST_PDF_PATH) pdf_to_insert = 'test_files/page_01.pdf' pypdftk.replace_page(TEST_PDF_PATH, 3, pdf_to_insert) self.assertEqual(total_pages, pypdftk.get_num_pages(TEST_PDF_PATH))