def test_downloader_http_errors(self):
with responses.RequestsMock(assert_all_requests_are_fired=True) as rsps:
rsps.add(responses.GET, self.TEST_MPD_URL, status=500)
rsps.add(responses.GET, self.TEST_MPD_URL, status=404)
dl = live.Downloader(
mpd=self.TEST_MPD_URL,
output_dir='output_httperrors',
duplicate_etag_retry=2,
singlethreaded=True)
dl.run()
dl.stream_id = '17875351285037717'
output_file = 'output_httperrors.mp4'
dl.stitch(output_file, cleartempfiles=True)
self.assertFalse(os.path.isfile(output_file), '{0!s} is generated'.format(output_file))
test_live.py 文件源码
python
阅读 23
收藏 0
点赞 0
评论 0
评论列表
文章目录