Use bytestring filenames in embedart tests

First step on #1461.
This commit is contained in:
Adrian Sampson 2015-05-19 16:09:39 -07:00
parent a7eace81d4
commit 36c2241a34
2 changed files with 5 additions and 6 deletions

View file

@ -169,11 +169,11 @@ class TestCase(unittest.TestCase):
def assertExists(self, path):
self.assertTrue(os.path.exists(path),
'file does not exist: %s' % path)
'file does not exist: {!r}'.format(path))
def assertNotExists(self, path):
self.assertFalse(os.path.exists(path),
'file exists: %s' % path)
'file exists: {!r}'.format((path)))
class LibTestCase(TestCase):

View file

@ -133,16 +133,15 @@ class EmbedartCliTest(_common.TestCase, TestHelper):
self.abbey_similarpath))
def test_non_ascii_album_path(self):
resource_path = os.path.join(_common.RSRC, 'image.mp3')
resource_path = os.path.join(_common.RSRC, 'image.mp3').encode('utf8')
album = self.add_album_fixture()
trackpath = album.items()[0].path
albumpath = album.path
shutil.copy(resource_path, trackpath.decode('utf-8'))
shutil.copy(syspath(resource_path), syspath(trackpath))
self.run_command('extractart', '-n', 'extracted')
self.assertExists(os.path.join(albumpath.decode('utf-8'),
'extracted.png'))
self.assertExists(syspath(os.path.join(albumpath, b'extracted.png')))
@patch('beets.art.subprocess')