def test_generate_thumbnail_valid_multiple_pages(self): generator = BareResourceGenerator() generator.data = MagicMock( return_value=[ {"type": "html", "data": "Page 1"}, {"type": "html", "data": "Page 2", "thumbnail": True} ] ) thumbnail_data = generator.generate_thumbnail() self.assertEqual(thumbnail_data["data"], "Page 2")
def test_generate_thumbnail_valid_single_page(self): generator = BareResourceGenerator() thumbnail_data = generator.generate_thumbnail() self.assertEqual(thumbnail_data["data"], "Page 1")