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)
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)
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)
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)
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)