class PILTestCase(unittest.TestCase, BaseCase): def setUp(self): self.engine = PILEngine() self.bg_path = 'src/bg.png' self.img_dir = 'src/control_instances/created_with_pil/png/' def get_comparable_image(self, options): """ Creates a watermarked image """ bg = PILImage.open(self.bg_path) mark = self.engine.watermark(bg, options) return mark
class PILTestCase(BaseCase): def __init__(self, *args, **kwargs): super(PILTestCase, self).__init__(*args, **kwargs) self.engine = PILEngine() def get_comparable_image(self, options): """ Creates a watermarked image """ # https://github.com/python-pillow/Pillow/issues/835 with open(self.bg_path, 'rb') as bg_file: with PILImage.open(bg_file) as bg: mark = self.engine.watermark(bg, options) return mark
def __init__(self, *args, **kwargs): super(PILTestCase, self).__init__(*args, **kwargs) self.engine = PILEngine()
def setUp(self): self.engine = PILEngine() self.bg_path = 'src/bg.png' self.img_dir = 'src/control_instances/created_with_pil/png/'