|
@@ -1,5 +1,4 @@
|
|
|
import os
|
|
|
-import shutil
|
|
|
|
|
|
import mutagen
|
|
|
import pytest
|
|
@@ -7,16 +6,6 @@ import pytest
|
|
|
from symuid._tag_interface import ID3
|
|
|
|
|
|
|
|
|
-@pytest.fixture
|
|
|
-def empty_id3_iface(tmpdir, tracks_dir_path):
|
|
|
- path = tmpdir.join('empty.mp3').strpath
|
|
|
- shutil.copyfile(
|
|
|
- src=os.path.join(tracks_dir_path, 'id3v2.4-empty.mp3'),
|
|
|
- dst=path,
|
|
|
- )
|
|
|
- return ID3(mutagen.File(path))
|
|
|
-
|
|
|
-
|
|
|
@pytest.mark.parametrize('track_name', ['id3v2.4-empty.mp3'])
|
|
|
def test_get_track_path(tracks_dir_path, track_name):
|
|
|
track_path = os.path.join(tracks_dir_path, track_name)
|
|
@@ -44,7 +33,8 @@ def test_get_comment(tracks_dir_path, track_name, expected_comment):
|
|
|
assert expected_comment == iface.get_comment()
|
|
|
|
|
|
|
|
|
-def test_set_comment(empty_id3_iface):
|
|
|
+def test_set_comment(empty_id3_path):
|
|
|
+ empty_id3_iface = ID3(mutagen.File(empty_id3_path))
|
|
|
assert empty_id3_iface.get_comment() is None
|
|
|
empty_id3_iface.set_comment('latin')
|
|
|
assert empty_id3_iface.get_comment() == 'latin'
|