diff options
author | pukkandan <pukkandan.ytdlp@gmail.com> | 2021-08-09 17:40:24 +0530 |
---|---|---|
committer | pukkandan <pukkandan.ytdlp@gmail.com> | 2021-08-10 01:22:55 +0530 |
commit | ad3dc496bbf2e2a574a16244ddde0740778e5daf (patch) | |
tree | f4eeaf0711946c1181ce1769c33d8ff94c3847cd /test/test_postprocessors.py | |
parent | 2831b4686c2436cd151260539e010ce3577911cc (diff) | |
download | hypervideo-pre-ad3dc496bbf2e2a574a16244ddde0740778e5daf.tar.lz hypervideo-pre-ad3dc496bbf2e2a574a16244ddde0740778e5daf.tar.xz hypervideo-pre-ad3dc496bbf2e2a574a16244ddde0740778e5daf.zip |
Misc fixes - See desc
* Remove unnecessary uses of _list_from_options_callback
* Fix download tests - Bug from 6e84b21559f586ee4d6affb61688d5c6a0c21221
* Rename ExecAfterDownloadPP to ExecPP and refactor its tests
* Ensure _write_ytdl_file closes file handle on error - Potential fix for #517
Diffstat (limited to 'test/test_postprocessors.py')
-rw-r--r-- | test/test_postprocessors.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/test/test_postprocessors.py b/test/test_postprocessors.py index 320e69e88..b15cbd28c 100644 --- a/test/test_postprocessors.py +++ b/test/test_postprocessors.py @@ -11,7 +11,7 @@ sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from yt_dlp import YoutubeDL from yt_dlp.compat import compat_shlex_quote from yt_dlp.postprocessor import ( - ExecAfterDownloadPP, + ExecPP, FFmpegThumbnailsConvertorPP, MetadataFromFieldPP, MetadataParserPP, @@ -59,12 +59,12 @@ class TestConvertThumbnail(unittest.TestCase): os.remove(file.format(out)) -class TestExecAfterDownload(unittest.TestCase): +class TestExec(unittest.TestCase): def test_parse_cmd(self): - pp = ExecAfterDownloadPP(YoutubeDL(), '') + pp = ExecPP(YoutubeDL(), '') info = {'filepath': 'file name'} - quoted_filepath = compat_shlex_quote(info['filepath']) + cmd = 'echo %s' % compat_shlex_quote(info['filepath']) - self.assertEqual(pp.parse_cmd('echo', info), 'echo %s' % quoted_filepath) - self.assertEqual(pp.parse_cmd('echo.{}', info), 'echo.%s' % quoted_filepath) - self.assertEqual(pp.parse_cmd('echo "%(filepath)s"', info), 'echo "%s"' % info['filepath']) + self.assertEqual(pp.parse_cmd('echo', info), cmd) + self.assertEqual(pp.parse_cmd('echo {}', info), cmd) + self.assertEqual(pp.parse_cmd('echo %(filepath)q', info), cmd) |