mirror of
https://github.com/fergalmoran/picard.git
synced 2025-12-25 10:48:18 +00:00
PICARD-321: Support backslash in filenames on non-Windows OS
With this change backslashes can be used in filenames on systems other than Windows. Only if Windows compatibility is activated backslashes will be replaced as before.
This commit is contained in:
@@ -63,6 +63,26 @@ class SanitizeDateTest(PicardTestCase):
|
||||
self.assertNotEqual(util.sanitize_date("2006.03.02"), "2006-03-02")
|
||||
|
||||
|
||||
class SanitizeFilenameTest(PicardTestCase):
|
||||
|
||||
def test_replace_slashes(self):
|
||||
self.assertEqual(util.sanitize_filename("AC/DC"), "AC_DC")
|
||||
|
||||
def test_custom_replacement(self):
|
||||
self.assertEqual(util.sanitize_filename("AC/DC", "|"), "AC|DC")
|
||||
|
||||
def test_win_compat(self):
|
||||
self.assertEqual(util.sanitize_filename("AC\\/DC", win_compat=True), "AC__DC")
|
||||
|
||||
@unittest.skipUnless(IS_WIN, "windows test")
|
||||
def test_replace_backslashes(self):
|
||||
self.assertEqual(util.sanitize_filename("AC\\DC"), "AC_DC")
|
||||
|
||||
@unittest.skipIf(IS_WIN, "non-windows test")
|
||||
def test_keep_backslashes(self):
|
||||
self.assertEqual(util.sanitize_filename("AC\\DC"), "AC\\DC")
|
||||
|
||||
|
||||
class TranslateArtistTest(PicardTestCase):
|
||||
|
||||
def test_latin(self):
|
||||
|
||||
Reference in New Issue
Block a user