|
@@ -0,0 +1,18 @@
|
|
|
+import pytest
|
|
|
+
|
|
|
+from symuid.tag_interface import ID3
|
|
|
+
|
|
|
+import mutagen
|
|
|
+import os
|
|
|
+import shutil
|
|
|
+
|
|
|
+
|
|
|
+@pytest.mark.parametrize(('track_name', 'tag_label', 'expected_text'), [
|
|
|
+ ('id3v2.4-empty.mp3', 'TPE1', None),
|
|
|
+ ('id3v2.4-typical.mp3', 'TPE1', 'some artist'),
|
|
|
+ ('id3v2.4-typical.mp3', 'COMM::eng', 'some comment'),
|
|
|
+ ('id3v2.4-typical.mp3', 'COMM', None),
|
|
|
+])
|
|
|
+def test__get_single_text(tracks_dir_path, track_name, tag_label, expected_text):
|
|
|
+ iface = ID3(mutagen.File(os.path.join(tracks_dir_path, track_name)))
|
|
|
+ assert expected_text == iface._get_single_text(tag_label)
|