aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_YoutubeDL.py
diff options
context:
space:
mode:
authorJesús <heckyel@hyperbola.info>2022-02-05 10:48:13 -0500
committerJesús <heckyel@hyperbola.info>2022-02-05 10:48:13 -0500
commitc4b763b19f54ed5dfc2fd408adb9ed74126f6740 (patch)
tree1bbf4450644370608f97bf6d4d7db818c5039f55 /test/test_YoutubeDL.py
parent5aac4e0267e32d98eb68692afedafda3b41ea629 (diff)
parenta3125791c7a5cdf2c8c025b99788bf686edd1a8a (diff)
downloadhypervideo-pre-c4b763b19f54ed5dfc2fd408adb9ed74126f6740.tar.lz
hypervideo-pre-c4b763b19f54ed5dfc2fd408adb9ed74126f6740.tar.xz
hypervideo-pre-c4b763b19f54ed5dfc2fd408adb9ed74126f6740.zip
updated from upstream | 05/02/2022 at 10:48
Diffstat (limited to 'test/test_YoutubeDL.py')
-rw-r--r--test/test_YoutubeDL.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/test/test_YoutubeDL.py b/test/test_YoutubeDL.py
index 61923513e..34ed814b4 100644
--- a/test/test_YoutubeDL.py
+++ b/test/test_YoutubeDL.py
@@ -30,6 +30,7 @@ class YDL(FakeYDL):
self.msgs = []
def process_info(self, info_dict):
+ info_dict = info_dict.copy()
info_dict.pop('__original_infodict', None)
self.downloaded_info_dicts.append(info_dict)
@@ -645,6 +646,7 @@ class TestYoutubeDL(unittest.TestCase):
'ext': 'mp4',
'width': None,
'height': 1080,
+ 'filesize': 1024,
'title1': '$PATH',
'title2': '%PATH%',
'title3': 'foo/bar\\test',
@@ -778,8 +780,9 @@ class TestYoutubeDL(unittest.TestCase):
test('%(title5)#U', 'a\u0301e\u0301i\u0301 𝐀')
test('%(title5)+U', 'áéí A')
test('%(title5)+#U', 'a\u0301e\u0301i\u0301 A')
- test('%(height)D', '1K')
- test('%(height)5.2D', ' 1.08K')
+ test('%(height)D', '1k')
+ test('%(filesize)#D', '1Ki')
+ test('%(height)5.2D', ' 1.08k')
test('%(title4)#S', 'foo_bar_test')
test('%(title4).10S', ('foo \'bar\' ', 'foo \'bar\'' + ('#' if compat_os_name == 'nt' else ' ')))
if compat_os_name == 'nt':
@@ -906,7 +909,7 @@ class TestYoutubeDL(unittest.TestCase):
def _match_entry(self, info_dict, incomplete=False):
res = super(FilterYDL, self)._match_entry(info_dict, incomplete)
if res is None:
- self.downloaded_info_dicts.append(info_dict)
+ self.downloaded_info_dicts.append(info_dict.copy())
return res
first = {
@@ -1151,6 +1154,7 @@ class TestYoutubeDL(unittest.TestCase):
self.assertTrue(entries[1] is None)
self.assertEqual(len(ydl.downloaded_info_dicts), 1)
downloaded = ydl.downloaded_info_dicts[0]
+ entries[2].pop('requested_downloads', None)
self.assertEqual(entries[2], downloaded)
self.assertEqual(downloaded['url'], TEST_URL)
self.assertEqual(downloaded['title'], 'Video Transparent 2')