Merge branch 'master' of https://github.com/rg3/youtube-dl
[youtube-dl] / test / test_download.py
index 8b9b833735990ce2655fa7467488d95951f079ae..40d596fdf1cf2e4b596917f28ecf431ef024014a 100644 (file)
@@ -85,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'])
@@ -106,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