From c086a634b6006b6a956c4e16dd439fe02e1f542a Mon Sep 17 00:00:00 2001 From: Peter Kessen Date: Sat, 5 Dec 2015 14:58:03 +0100 Subject: [PATCH 1/2] Fixed testcase TestLibrary.test_no_write_permission on windows it is important to use syspath with functions to modify path --- test/test_library.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/test_library.py b/test/test_library.py index 30b0d6fc4..c6dfc3d20 100644 --- a/test/test_library.py +++ b/test/test_library.py @@ -36,6 +36,7 @@ from beets import util from beets import plugins from beets import config from beets.mediafile import MediaFile +from beets.util import syspath from test.helper import TestHelper # Shortcut to path normalization. @@ -1044,7 +1045,7 @@ class WriteTest(unittest.TestCase, TestHelper): def test_no_write_permission(self): item = self.add_item_fixture() - path = item.path + path = syspath(item.path) os.chmod(path, stat.S_IRUSR) try: From ceafad2651eb84447c9fae5a004281f6864ce493 Mon Sep 17 00:00:00 2001 From: Peter Kessen Date: Sat, 5 Dec 2015 15:05:25 +0100 Subject: [PATCH 2/2] Fixed testcase TestLibrary.test_write_with_custom_path on windows it is important to use syspath with functions to modify path --- test/test_library.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_library.py b/test/test_library.py index c6dfc3d20..c544e007e 100644 --- a/test/test_library.py +++ b/test/test_library.py @@ -1058,7 +1058,7 @@ class WriteTest(unittest.TestCase, TestHelper): def test_write_with_custom_path(self): item = self.add_item_fixture() custom_path = os.path.join(self.temp_dir, 'custom.mp3') - shutil.copy(item.path, custom_path) + shutil.copy(syspath(item.path), syspath(custom_path)) item['artist'] = 'new artist' self.assertNotEqual(MediaFile(custom_path).artist, 'new artist')