コード例 #1
0
    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
コード例 #2
0
ファイル: tests.py プロジェクト: AndrewIngram/django-oscar
 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))
コード例 #3
0
    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))
コード例 #4
0
ファイル: tests.py プロジェクト: AndrewIngram/django-oscar
 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