From 953cb75712e6e1d8edc90b53c2161bc3e4f992ca Mon Sep 17 00:00:00 2001 From: Pierre Ayoub Date: Wed, 3 Jul 2024 14:21:34 +0200 Subject: [PATCH] Add a unit test for playlist file extension --- test/plugins/test_convert.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/plugins/test_convert.py b/test/plugins/test_convert.py index 6dd28337a..ce3f159e6 100644 --- a/test/plugins/test_convert.py +++ b/test/plugins/test_convert.py @@ -293,6 +293,17 @@ class ConvertCliTest(ConvertTestCase, ConvertCommand): m3u_created = os.path.join(self.convert_dest, b"playlist.m3u8") assert not os.path.exists(m3u_created) + def test_playlist_ext(self): + """Test correct extension of file inside the playlist when format conversion occurs.""" + # We expect a converted file with the MP3 extension. + self.config["convert"]["format"] = "mp3" + with control_stdin("y"): + self.run_convert("--playlist", "playlist.m3u8") + # Check playlist content. + m3u_created = os.path.join(self.convert_dest, b"playlist.m3u8") + with open(m3u_created, "r") as m3u_file: + self.assertTrue(m3u_file.readline() == "#EXTM3U\n") + self.assertTrue(m3u_file.readline() == "converted.mp3\n") @_common.slow_test() class NeverConvertLossyFilesTest(ConvertTestCase, ConvertCommand):