def test_pdf_multiple_pages(self):
     generator = BareResourceGenerator()
     generator.data = MagicMock(
         return_value=[
             {"type": "html", "data": "Page 1"},
             {"type": "html", "data": "Page 2"},
         ]
     )
     (pdf_file, filename) = generator.pdf("Test")
     pdf = PdfFileReader(BytesIO(pdf_file))
     self.assertEqual(pdf.getNumPages(), 2)
 def test_pdf_single_page(self):
     generator = BareResourceGenerator()
     (pdf_file, filename) = generator.pdf("Test")
     pdf = PdfFileReader(BytesIO(pdf_file))
     self.assertEqual(pdf.getNumPages(), 1)