test_swift.py 文件源码

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

项目:stor 作者: counsyl 项目源码 文件源码
def test_progress_logging(self):
        self.mock_swift.download.return_value = [
            {
                'action': 'download_object',
                'read_length': 100
            }
            for i in range(20)
        ]
        self.mock_swift.download.return_value.append({'action': 'random_action'})

        swift_p = SwiftPath('swift://tenant/container')
        with LogCapture('stor.swift.progress') as progress_log:
            swift_p.download('output_dir')
            progress_log.check(
                ('stor.swift.progress', 'INFO', 'starting download'),
                ('stor.swift.progress', 'INFO', '10\t0:00:00\t0.00 MB\t0.00 MB/s'),  # nopep8
                ('stor.swift.progress', 'INFO', '20\t0:00:00\t0.00 MB\t0.00 MB/s'),  # nopep8
                ('stor.swift.progress', 'INFO', 'download complete - 20\t0:00:00\t0.00 MB\t0.00 MB/s'),  # nopep8
            )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号