Commit 4c779520 authored by petitminion's avatar petitminion
Browse files

Update api/tests/playlists/test_utils.py

parent 5555382f
Pipeline #15639 failed with stages
in 32 seconds
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")
Supports Markdown
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