From e978789f0f0bfe1963f4a295f6094dafa7524933 Mon Sep 17 00:00:00 2001 From: PilzAdam Date: Fri, 17 Dec 2021 21:35:48 +0100 Subject: [outtmpl] Add operator `&` for replacement text (#2012) Authored by: PilzAdam --- test/test_YoutubeDL.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test') diff --git a/test/test_YoutubeDL.py b/test/test_YoutubeDL.py index 63ef50e1a..6c2530046 100644 --- a/test/test_YoutubeDL.py +++ b/test/test_YoutubeDL.py @@ -836,6 +836,11 @@ 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({}), '') -- cgit v1.2.3