def test_pad_fail(self): """ Attempt to pad an image with desired size smaller than original size. """ im = Image.fromarray(self.pixels, mode='RGB') try: image_utils.pad(im, (4, 3)) except AssertionError: return True raise AssertionError
def test_pad_fail(self): """ Attempt to pad an image with desired size smaller than original size. """ im = Image.fromarray(self.pixels, mode="RGB") try: image_utils.pad(im, (4, 3)) except AssertionError: return True raise AssertionError
def test_pad(self): """Pad an image.""" im = Image.fromarray(self.pixels, mode='RGB') im = image_utils.pad(im, (7, 8)) assert im.size == (8, 7)
def test_pad(self): """Pad an image.""" im = Image.fromarray(self.pixels, mode="RGB") im = image_utils.pad(im, (7, 8)) assert im.size == (8, 7)