def test_resize_rounding(self): mod = ResizeMod(self.image, dict(width=200)) im = mod.apply() self.assertEquals(im.size, (200, 235)) # Check scaling rounds up mod = ResizeMod(self.image, dict(height=200)) im = mod.apply() self.assertEquals(im.size, (171, 200))
def test_resize(self): mod = ResizeMod(self.image, dict(width=200, height=200)) im = mod.apply() self.assertEquals(im.size, (200, 200)) self.assertEquals(self.image.size, (1535, 1800)) # Mod shouldn't change original