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):