From 9930a5da5939acc62d6fe64d949dc11b3777331b Mon Sep 17 00:00:00 2001 From: J0J0 T Date: Wed, 10 Aug 2022 07:17:56 +0200 Subject: [PATCH] convert: playlist: Test playlist existence Broken commit around writing a unittest that checks for existence of an m3u file after convert has been called with --playlist option. --- test/test_convert.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/test/test_convert.py b/test/test_convert.py index 7cdef4627..f114a04dc 100644 --- a/test/test_convert.py +++ b/test/test_convert.py @@ -184,8 +184,9 @@ class ConvertCliTest(unittest.TestCase, TestHelper, ConvertCommand): } def tearDown(self): - self.unload_plugins() - self.teardown_beets() + pass + #self.unload_plugins() + #self.teardown_beets() def test_convert(self): with control_stdin('y'): @@ -293,6 +294,19 @@ class ConvertCliTest(unittest.TestCase, TestHelper, ConvertCommand): converted = os.path.join(self.convert_dest, b'converted.ogg') self.assertNoFileTag(converted, 'ogg') + def test_playlist(self): + with control_stdin('y'): + self.run_convert('--playlist', 'playlist.m3u8') + converted = os.path.join(self.convert_dest, b'converted.mp3') + self.assertFileTag(converted, 'mp3') + m3u_created = os.path.join(self.convert_dest, b'playlist.m3u8') + self.assertTrue(os.path.exists(m3u_created)) + + def test_playlist_pretend(self): + self.run_convert('--playlist', 'playlist.m3u8', '--pretend') + m3u_created = os.path.join(self.convert_dest, b'playlist.m3u8') + self.assertFalse(os.path.exists(m3u_created)) + @_common.slow_test() class NeverConvertLossyFilesTest(unittest.TestCase, TestHelper,