Add a unit test for playlist file extension

This commit is contained in:
Pierre Ayoub 2024-07-03 14:21:34 +02:00 committed by Pierre Ayoub
parent dad1b2e4e1
commit 953cb75712
No known key found for this signature in database
GPG key ID: B1AF6307DB5EB778

View file

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