mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 05:09:16 +02:00
19 lines
576 B
Python
19 lines
576 B
Python
import os
|
|
|
|
from defusedxml import ElementTree as etree
|
|
|
|
from funkwhale_api.playlists import models, utils
|
|
|
|
|
|
def test_get_track_id_from_xspf(factories, tmp_path):
|
|
track1 = factories["music.Track"]()
|
|
track2 = factories["music.Track"]()
|
|
tracks_ids = [track1.id, track2.id]
|
|
xspf_content = utils.generate_xspf_from_tracks_ids(tracks_ids)
|
|
f = open("test.xspf", "w")
|
|
f.write(xspf_content)
|
|
f.close()
|
|
xspf_file = "test.xspf"
|
|
expected = [track1.id, track2.id]
|
|
assert utils.get_track_id_from_xspf(xspf_file) == expected
|
|
os.remove("test.xspf")
|