]> jfr.im git - yt-dlp.git/blobdiff - test/test_download.py
Completely change project name to yt-dlp (#85)
[yt-dlp.git] / test / test_download.py
index 0e9f293b5dc61f86e734e2b3d1971cbcfba64c95..5559b4d6fef15d0857bc10c9064e4ce963876522 100644 (file)
 import json
 import socket
 
-import youtube_dl.YoutubeDL
-from youtube_dl.compat import (
+import yt_dlp.YoutubeDL
+from yt_dlp.compat import (
     compat_http_client,
     compat_urllib_error,
     compat_HTTPError,
 )
-from youtube_dl.utils import (
+from yt_dlp.utils import (
     DownloadError,
     ExtractorError,
     format_bytes,
     UnavailableVideoError,
 )
-from youtube_dl.extractor import get_info_extractor
+from yt_dlp.extractor import get_info_extractor
 
 RETRIES = 3
 
 
-class YoutubeDL(youtube_dl.YoutubeDL):
+class YoutubeDL(yt_dlp.YoutubeDL):
     def __init__(self, *args, **kwargs):
         self.to_stderr = self.to_screen
         self.processed_info_dicts = []
@@ -92,8 +92,8 @@ def setUp(self):
 def generator(test_case, tname):
 
     def test_template(self):
-        ie = youtube_dl.extractor.get_info_extractor(test_case['name'])
-        other_ies = [get_info_extractor(ie_key) for ie_key in test_case.get('add_ie', [])]
+        ie = yt_dlp.extractor.get_info_extractor(test_case['name'])()
+        other_ies = [get_info_extractor(ie_key)() for ie_key in test_case.get('add_ie', [])]
         is_playlist = any(k.startswith('playlist') for k in test_case)
         test_cases = test_case.get(
             'playlist', [] if is_playlist else [test_case])
@@ -225,7 +225,7 @@ def try_rm_tcs_files(tcs=None):
                                 format_bytes(got_fsize)))
                     if 'md5' in tc:
                         md5_for_file = _file_md5(tc_filename)
-                        self.assertEqual(md5_for_file, tc['md5'])
+                        self.assertEqual(tc['md5'], md5_for_file)
                 # Finally, check test cases' data again but this time against
                 # extracted data from info JSON file written during processing
                 info_json_fn = os.path.splitext(tc_filename)[0] + '.info.json'