Пример #1
0
    def testSubdir(self):
        """Test a file that is in a sub-directory of img_path."""

        r = _resizer('square', '100', self.img_path)
        new_name = r.get_thumbnail_name(self.path('subdir',
                                                  'sample_image.jpg'))
        self.assertEqual('subdir/sample_image_square.jpg', new_name)
Пример #2
0
 def testSquare(self):
     r = _resizer('square', '100', self.img_path)
     output = r.resize(self.img)
     self.assertEqual((100, 100), output.size)
Пример #3
0
 def testHeight(self):
     r = _resizer('aspect', '?x250')
     output = r.resize(self.img)
     self.assertEqual((375, 250), output.size)
Пример #4
0
 def testWidth(self):
     r = _resizer('aspect', '250x?')
     output = r.resize(self.img)
     self.assertEqual((250, 166), output.size)
Пример #5
0
 def testExact(self):
     r = _resizer('exact', '250x100')
     output = r.resize(self.img)
     self.assertEqual((250, 100), output.size)
Пример #6
0
 def testSquare(self):
     r = _resizer("square", "100", self.img_path)
     output = r.resize(self.img)
     self.assertEqual((100, 100), output.size)
Пример #7
0
 def testRootWithSlash(self):
     r = _resizer('square', '100', self.img_path + '/')
     new_name = r.get_thumbnail_name(self.path('sample_image.jpg'))
     self.assertEqual('sample_image_square.jpg', new_name)
Пример #8
0
 def testHeight(self):
     r = _resizer('aspect', '?x250', self.img_path)
     output = r.resize(self.img)
     self.assertEqual((375, 250), output.size)
Пример #9
0
    def testSubdir(self):
        """Test a file that is in a sub-directory of img_path."""

        r = _resizer("square", "100", self.img_path)
        new_name = r.get_thumbnail_name(self.path("subdir", "sample_image.jpg"))
        self.assertEqual("subdir/sample_image_square.jpg", new_name)
Пример #10
0
 def testRootWithSlash(self):
     r = _resizer("square", "100", self.img_path + "/")
     new_name = r.get_thumbnail_name(self.path("sample_image.jpg"))
     self.assertEqual("sample_image_square.jpg", new_name)
Пример #11
0
    def testRoot(self):
        """Test a file that is in the root of img_path."""

        r = _resizer("square", "100", self.img_path)
        new_name = r.get_thumbnail_name(self.path("sample_image.jpg"))
        self.assertEqual("sample_image_square.jpg", new_name)
Пример #12
0
 def testHeight(self):
     r = _resizer("aspect", "?x250", self.img_path)
     output = r.resize(self.img)
     self.assertEqual((375, 250), output.size)
Пример #13
0
 def testWidth(self):
     r = _resizer("aspect", "250x?", self.img_path)
     output = r.resize(self.img)
     self.assertEqual((250, 166), output.size)
Пример #14
0
 def testExact(self):
     r = _resizer("exact", "250x100", self.img_path)
     output = r.resize(self.img)
     self.assertEqual((250, 100), output.size)
Пример #15
0
 def testExact(self):
     r = _resizer('exact', '250x100', self.img_path)
     output = r.resize(self.img)
     self.assertEqual((250, 100), output.size)
Пример #16
0
 def testWidth(self):
     r = _resizer('aspect', '250x?', self.img_path)
     output = r.resize(self.img)
     self.assertEqual((250, 166), output.size)
    def testRoot(self):
        """Test a file that is in the root of img_path."""

        r = _resizer('square', '100', self.img_path)
        new_name = r.get_thumbnail_name(self.path('sample_image.jpg'))
        self.assertEqual('sample_image_square.jpg', new_name)
Пример #18
0
    def testRoot(self):
        """Test a file that is in the root of img_path."""

        r = _resizer('square', '100', self.img_path)
        new_name = r.get_thumbnail_name(self.path('sample_image.jpg'))
        self.assertEqual('sample_image_square.jpg', new_name)
    def testSubdir(self):
        """Test a file that is in a sub-directory of img_path."""

        r = _resizer('square', '100', self.img_path)
        new_name = r.get_thumbnail_name(self.path('subdir', 'sample_image.jpg'))
        self.assertEqual('subdir/sample_image_square.jpg', new_name)
Пример #20
0
 def testSquare(self):
     r = _resizer('square', '100')
     output = r.resize(self.img)
     self.assertEqual((100, 100), output.size)
Пример #21
0
 def testRootWithSlash(self):
     r = _resizer('square', '100', self.img_path + '/')
     new_name = r.get_thumbnail_name(self.path('sample_image.jpg'))
     self.assertEqual('sample_image_square.jpg', new_name)