def test_save_file(self):
file_path_fixture = self.get_fixture_file_path("thumbnails/th01.png")
th_file = FileStorage(
stream=open(file_path_fixture, "rb"),
filename="th01.png"
)
full_path = thumbnail.save_file("shots", "instance-id", th_file)
thumbnail.turn_into_thumbnail(full_path, thumbnail.RECTANGLE_SIZE)
im = Image.open(full_path)
(width, height) = im.size
self.assertEqual(width, 150)
self.assertEqual(height, 100)
评论列表
文章目录