Use only valid media files as fixtures

This commit is contained in:
Thomas Scholtes 2014-04-11 00:06:42 +02:00
parent 6989d77a7a
commit 287428e805
2 changed files with 4 additions and 4 deletions

View file

@ -153,11 +153,11 @@ class TestHelper(object):
items.append(item)
return items
def create_file_fixture(self, pattern='*.mp3'):
"""Copies a file matching the glob pattern to a temporary
def create_mediafile_fixture(self, ext='mp3'):
"""Copies a fixture mediafile with the extension to a temporary
location and returns the path.
"""
src = glob(os.path.join(_common.RSRC, pattern))[0]
src = os.path.join(_common.RSRC, 'full.' + ext)
handle, path = mkstemp()
os.close(handle)
shutil.copy(src, path)

View file

@ -50,7 +50,7 @@ class ZeroPluginTest(unittest.TestCase, TestHelper):
self.assertEqual(i.year, 2012)
def test_delete_replaygain_tag(self):
path = self.create_file_fixture()
path = self.create_mediafile_fixture()
item = Item.from_path(path)
item.rg_track_peak = 0.0
item.write()