diff options
author | Philipp Hagemeister <[email protected]> | 2013-01-12 20:34:50 +0100 |
---|---|---|
committer | Philipp Hagemeister <[email protected]> | 2013-01-12 20:34:50 +0100 |
commit | bffbd5f03806836d5a55f65542ad6061a7a03ccb (patch) | |
tree | c2400bbc0be35b3f8433556a165a2f91bbf1a476 /test/test_download.py | |
parent | d8bbf2018effb0043dd418596ef1ab729239e129 (diff) | |
download | youtube-dl-bffbd5f03806836d5a55f65542ad6061a7a03ccb.tar.gz youtube-dl-bffbd5f03806836d5a55f65542ad6061a7a03ccb.zip |
Download progress hooks
Diffstat (limited to 'test/test_download.py')
-rw-r--r-- | test/test_download.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/test_download.py b/test/test_download.py index e36774de9..5877c42b3 100644 --- a/test/test_download.py +++ b/test/test_download.py @@ -82,6 +82,11 @@ def generator(test_case): fd.add_info_extractor(ie()) for ien in test_case.get('add_ie', []): fd.add_info_extractor(getattr(youtube_dl.InfoExtractors, ien + 'IE')()) + finished_hook_called = set() + def _hook(status): + if status['status'] == 'finished': + finished_hook_called.add(status['filename']) + fd.add_progress_hook(_hook) test_cases = test_case.get('playlist', [test_case]) for tc in test_cases: @@ -94,6 +99,7 @@ def generator(test_case): for tc in test_cases: if not test_case.get('params', {}).get('skip_download', False): self.assertTrue(os.path.exists(tc['file'])) + self.assertTrue(tc['file'] in finished_hook_called) self.assertTrue(os.path.exists(tc['file'] + '.info.json')) if 'md5' in tc: md5_for_file = _file_md5(tc['file']) |