def test_upload_progress_logging(self, mock_getsize, mock_files):
mock_files.return_value = {
'file%s' % i: 20
for i in range(20)
}
mock_getsize.return_value = 20
s3_p = S3Path('s3://bucket')
with LogCapture('stor.s3.progress') as progress_log:
s3_p.upload(['upload'])
progress_log.check(
('stor.s3.progress', 'INFO', 'starting upload of 20 objects'), # nopep8
('stor.s3.progress', 'INFO', '10/20\t0:00:00\t0.00 MB\t0.00 MB/s'), # nopep8
('stor.s3.progress', 'INFO', '20/20\t0:00:00\t0.00 MB\t0.00 MB/s'), # nopep8
('stor.s3.progress', 'INFO', 'upload complete - 20/20\t0:00:00\t0.00 MB\t0.00 MB/s'), # nopep8
)
评论列表
文章目录