Exemple #1
0
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
Exemple #2
0
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
Exemple #3
0
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
Exemple #4
0
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
Exemple #5
0
 def __init__(self, *args, **kwargs):
     super(PILTestCase, self).__init__(*args, **kwargs)
     self.engine = PILEngine()
Exemple #6
0
 def __init__(self, *args, **kwargs):
     super(PILTestCase, self).__init__(*args, **kwargs)
     self.engine = PILEngine()
Exemple #7
0
 def setUp(self):
     self.engine = PILEngine()
     self.bg_path = 'src/bg.png'
     self.img_dir = 'src/control_instances/created_with_pil/png/'
Exemple #8
0
 def setUp(self):
     self.engine = PILEngine()
     self.bg_path = 'src/bg.png'
     self.img_dir = 'src/control_instances/created_with_pil/png/'