aboutsummaryrefslogtreecommitdiff
path: root/test/test_download.py
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2013-01-01 19:07:06 +0100
committerPhilipp Hagemeister <phihag@phihag.de>2013-01-01 19:07:06 +0100
commit6985325e01c6b0b4a0b332dc066f2c00bc32503f (patch)
tree5184aac509f76f77409e0d1933ea5a2917b8fcc8 /test/test_download.py
parent911ee27e83e1d6b35b4c4f10e6ed9820a925eeda (diff)
Revert "In tests.json file and md5 join in a 'files' list to handle multiple-file IEs"
This made the JSON structure really unreadable and was a quick fix. This reverts commit 6535e9511fc18eee2fc640c77fd42a4a39791915.
Diffstat (limited to 'test/test_download.py')
-rw-r--r--test/test_download.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/test/test_download.py b/test/test_download.py
index 238195050..4ea889740 100644
--- a/test/test_download.py
+++ b/test/test_download.py
@@ -54,10 +54,9 @@ class TestDownload(unittest.TestCase):
self.tearDown()
def tearDown(self):
- for files in [ test['files'] for test in self.defs ]:
- for fn, md5 in files:
- if os.path.exists(fn):
- os.remove(fn)
+ for fn in [ test.get('file', False) for test in self.defs ]:
+ if fn and os.path.exists(fn):
+ os.remove(fn)
### Dynamically generate tests
@@ -68,6 +67,9 @@ 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
@@ -82,11 +84,10 @@ def generator(test_case):
fd.add_info_extractor(getattr(youtube_dl.InfoExtractors, ien + 'IE')())
fd.download([test_case['url']])
- 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)
+ 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'])
info_dict = fd.processed_info_dicts[0]
for (info_field, value) in test_case.get('info_dict', {}).items():
if value.startswith('md5:'):