X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=test%2Ftest_download.py;h=5b35c37e7115111493d51e52917a079bbdbdb450;hb=278986ea0f49b95506277c5f6b4875def231d8bb;hp=1ee1b334d3b5a8f251acb23f6fc48720d776d3c0;hpb=a7c0f8602e91cc96962c7eade10860b61afc3728;p=youtube-dl diff --git a/test/test_download.py b/test/test_download.py index 1ee1b334d..5b35c37e7 100644 --- a/test/test_download.py +++ b/test/test_download.py @@ -54,9 +54,10 @@ class TestDownload(unittest.TestCase): self.tearDown() def tearDown(self): - for fn in [ test.get('file', False) for test in self.defs ]: - if fn and os.path.exists(fn): - os.remove(fn) + for files in [ test['files'] for test in self.defs ]: + for fn, md5 in files: + if os.path.exists(fn): + os.remove(fn) ### Dinamically generate tests @@ -67,9 +68,6 @@ def generator(test_case): if not ie._WORKING: print('Skipping: IE marked as not _WORKING') return - if not test_case['file']: - print('Skipping: No output file specified') - return if 'skip' in test_case: print('Skipping: {0}'.format(test_case['skip'])) return @@ -84,10 +82,11 @@ def generator(test_case): fd.add_info_extractor(getattr(youtube_dl.InfoExtractors, ien + 'IE')()) fd.download([test_case['url']]) - self.assertTrue(os.path.exists(test_case['file'])) - if 'md5' in test_case: - md5_for_file = _file_md5(test_case['file']) - self.assertEqual(md5_for_file, test_case['md5']) + for filename, md5 in test_case['files']: + self.assertTrue(os.path.exists(filename)) + if md5: + md5_for_file = _file_md5(filename) + self.assertEqual(md5_for_file, md5) info_dict = fd.processed_info_dicts[0] for (info_field, value) in test_case.get('info_dict', {}).items(): if value.startswith('md5:'):