def test_pil(self):
        from PIL import Image

        pil_image = Image.open('vlogging/tests/lenna.jpg')
        s = str(vlogging.VisualRecord(
            title="title",
            imgs=pil_image,
            footnotes="footnotes"))

        self.assertTrue("title" in s)
        self.assertTrue(s in "footnotes")
        self.assertTrue("<pre>" in s)
        self.assertTrue("image/png" in s)
        self.assertEqual(s.count("<img"), 1)

        s = str(vlogging.VisualRecord(
            title="title",
            imgs=[pil_image],
            footnotes="footnotes"))

        self.assertEqual(s.count("<img"), 1)

        s = str(vlogging.VisualRecord(
            title="title",
            imgs=[pil_image, pil_image],
            footnotes="footnotes",
            fmt="jpeg"))

        self.assertTrue("image/jpeg" in s)
        self.assertEqual(s.count("<img"), 2)
dataset/ETHPy150Open dchaplinsky/visual-logging/vlogging/tests/basic.py/BasicTestCase.test_pil/swapped operands of `in`