def test_redimensiona_el_height(self): """Comprueba que el height es redimensionado a 150.""" create_image(size=[150, 300]) self.resize_image.resize(self.media_path(), 150, 150) with Image.open(self.media_path()) as image: self.assertEqual(image.size, (75, 150))
def test_redimension_sin_scale(self): """Prueba la redimension sin scale.""" create_image(size=[50, 300]) self.resize_image.scale = False self.resize_image.resize(self.media_path(), 200, 100) with Image.open(self.media_path()) as image: self.assertEqual(image.size, (200, 100))
def setUp(self): create_image(size=[300, 150]) self.media_path = get_image_path self.resize_image = ImageResize(self.media_path())