mirror of
https://github.com/beetbox/beets.git
synced 2025-12-28 19:42:42 +01:00
Use only valid media files as fixtures
This commit is contained in:
parent
6989d77a7a
commit
287428e805
2 changed files with 4 additions and 4 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Reference in a new issue