tests: Add metadata test with opus file

This adds a metadata test case for extracting data from an opus test
file. The added file is just converted from test.ogg and the same
metadata fields are used.
Signed-off-by: Toke Høiland-Jørgensen's avatarToke Høiland-Jørgensen <toke@toke.dk>
parent 0d128d40
Pipeline #1915 passed with stages
in 4 minutes and 35 seconds
......@@ -9,6 +9,26 @@ from funkwhale_api.music import metadata
DATA_DIR = os.path.dirname(os.path.abspath(__file__))
("title", "Peer Gynt Suite no. 1, op. 46: I. Morning"),
("artist", "Edvard Grieg"),
("album", "Peer Gynt Suite no. 1, op. 46"),
("date", datetime.date(2012, 8, 15)),
("track_number", 1),
("musicbrainz_albumid", uuid.UUID("a766da8b-8336-47aa-a3ee-371cc41ccc75")),
("musicbrainz_recordingid", uuid.UUID("bd21ac48-46d8-4e78-925f-d9cc2a294656")),
("musicbrainz_artistid", uuid.UUID("013c8e5b-d72a-4cd3-8dee-6c64d6125823")),
def test_can_get_metadata_from_opus_file(field, value):
path = os.path.join(DATA_DIR, "test.opus")
data = metadata.Metadata(path)
assert data.get(field) == value
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment