X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;ds=sidebyside;f=test%2Ftest_download.py;h=40d596fdf1cf2e4b596917f28ecf431ef024014a;hb=9cf98a2bcc9cae6bb308b42c0da3587b7d4115f2;hp=128ff9ae4fb7364a3f1ce0f77d4e6fa3724d85ab;hpb=5c892b0ba963713bd75d1c85698a660d9bc4bb05;p=youtube-dl diff --git a/test/test_download.py b/test/test_download.py index 128ff9ae4..40d596fdf 100644 --- a/test/test_download.py +++ b/test/test_download.py @@ -74,9 +74,8 @@ def generator(test_case): print('Skipping: {0}'.format(test_case['skip'])) return - params = dict(self.parameters) # Duplicate it locally - for p in test_case.get('params', {}): - params[p] = test_case['params'][p] + params = self.parameters.copy() + params.update(test_case.get('params', {})) fd = FileDownloader(params) fd.add_info_extractor(ie()) @@ -86,12 +85,14 @@ def generator(test_case): test_cases = test_case.get('playlist', [test_case]) for tc in test_cases: _try_rm(tc['file']) + _try_rm(tc['file'] + '.part') _try_rm(tc['file'] + '.info.json') try: fd.download([test_case['url']]) for tc in test_cases: - self.assertTrue(os.path.exists(tc['file'])) + if not test_case.get('params', {}).get('skip_download', False): + self.assertTrue(os.path.exists(tc['file'])) self.assertTrue(os.path.exists(tc['file'] + '.info.json')) if 'md5' in tc: md5_for_file = _file_md5(tc['file']) @@ -107,6 +108,7 @@ def generator(test_case): finally: for tc in test_cases: _try_rm(tc['file']) + _try_rm(tc['file'] + '.part') _try_rm(tc['file'] + '.info.json') return test_template