diff options
author | Jesús <heckyel@hyperbola.info> | 2021-12-29 19:12:28 -0500 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2021-12-29 19:12:28 -0500 |
commit | 5aac4e0267e32d98eb68692afedafda3b41ea629 (patch) | |
tree | c3b0f52d6a8cf4ad74e7f17f1ccd7653e1071471 /test/test_YoutubeDL.py | |
parent | 4f0875462ee497cc13c02d0b852f52f4887b5cea (diff) | |
parent | 96f13f01a609add83555ca86fbf35d11441361d8 (diff) | |
download | hypervideo-pre-5aac4e0267e32d98eb68692afedafda3b41ea629.tar.lz hypervideo-pre-5aac4e0267e32d98eb68692afedafda3b41ea629.tar.xz hypervideo-pre-5aac4e0267e32d98eb68692afedafda3b41ea629.zip |
updated from upstream | 29/12/2021 at 19:12
Diffstat (limited to 'test/test_YoutubeDL.py')
-rw-r--r-- | test/test_YoutubeDL.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/test/test_YoutubeDL.py b/test/test_YoutubeDL.py index 6c2530046..61923513e 100644 --- a/test/test_YoutubeDL.py +++ b/test/test_YoutubeDL.py @@ -717,6 +717,7 @@ class TestYoutubeDL(unittest.TestCase): test('%(id)s', '.abcd', info={'id': '.abcd'}) test('%(id)s', 'ab__cd', info={'id': 'ab__cd'}) test('%(id)s', ('ab:cd', 'ab -cd'), info={'id': 'ab:cd'}) + test('%(id.0)s', '-', info={'id': '--'}) # Invalid templates self.assertTrue(isinstance(YoutubeDL.validate_outtmpl('%(title)'), ValueError)) @@ -777,6 +778,10 @@ 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('%(title4)#S', 'foo_bar_test') + test('%(title4).10S', ('foo \'bar\' ', 'foo \'bar\'' + ('#' if compat_os_name == 'nt' else ' '))) if compat_os_name == 'nt': test('%(title4)q', ('"foo \\"bar\\" test"', "'foo _'bar_' test'")) test('%(formats.:.id)#q', ('"id 1" "id 2" "id 3"', "'id 1' 'id 2' 'id 3'")) @@ -808,6 +813,11 @@ class TestYoutubeDL(unittest.TestCase): test('%(width-100,height+width|def)s', 'def') test('%(timestamp-x>%H\\,%M\\,%S,timestamp>%H\\,%M\\,%S)s', '12,00,00') + # Replacement + test('%(id&foo)s.bar', 'foo.bar') + test('%(title&foo)s.bar', 'NA.bar') + test('%(title&foo|baz)s.bar', 'baz.bar') + # Laziness def gen(): yield from range(5) @@ -836,11 +846,6 @@ class TestYoutubeDL(unittest.TestCase): test('%(title3)s', ('foo/bar\\test', 'foo_bar_test')) test('folder/%(title3)s', ('folder/foo/bar\\test', 'folder%sfoo_bar_test' % os.path.sep)) - # Replacement - test('%(id&foo)s.bar', 'foo.bar') - test('%(title&foo)s.bar', 'NA.bar') - test('%(title&foo|baz)s.bar', 'baz.bar') - def test_format_note(self): ydl = YoutubeDL() self.assertEqual(ydl._format_note({}), '') |