test_thumbnail.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:zou 作者: cgwire 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号