Merge branch 'pkess:fix_test_windows'

This commit is contained in:
Peter Kessen 2015-12-05 15:10:37 +01:00
commit 4069e49f42

View file

@ -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:
@ -1057,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')