Browse Source

prepare symuid._tag_interface.OggOpus implementation

Fabian Peter Hammerle 4 years ago
parent
commit
f1162cef8c

+ 29 - 0
symuid/_tag_interface.py

@@ -208,3 +208,32 @@ class MP4(_MutagenTagInterface):
 
     def set_track_uuid(self, uuid):
         return self._set_free_uuid(self._UUID_TAG_KEY, uuid)
+
+
+class OggOpus(_MutagenTagInterface):
+
+    def __init__(self, mutagen_file):
+        assert isinstance(mutagen_file.tags, mutagen.oggopus.OggOpusVComment), \
+            (mutagen_file, mutagen_file.tags)
+        super().__init__(mutagen_file)
+
+    def get_comment(self):
+        raise NotImplementedError()
+
+    def set_comment(self, comment):
+        raise NotImplementedError()
+
+    def get_track_uuid(self):
+        raise NotImplementedError()
+
+    def set_track_uuid(self, uuid):
+        raise NotImplementedError()
+
+    def get_free_int(self, tag_label):
+        raise NotImplementedError()
+
+    def set_free_int(self, tag_label, data):
+        raise NotImplementedError()
+
+    def get_free_ints(self, tag_label_prefix):
+        raise NotImplementedError()

+ 15 - 0
tests/tag_interface/test_ogg_vorbis.py

@@ -0,0 +1,15 @@
+import os
+
+import mutagen
+import pytest
+
+from symuid._tag_interface import OggOpus
+
+# pylint: disable=protected-access
+
+
+@pytest.mark.parametrize('track_name', ['ogg-opus-empty.opus'])
+def test_get_track_path(tracks_dir_path, track_name):
+    track_path = os.path.join(tracks_dir_path, track_name)
+    iface = OggOpus(mutagen.File(track_path))
+    assert track_path == iface.track_path

BIN
tests/tracks/ogg-opus-empty.opus