Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
petitminion
funkwhale
Commits
cab28a47
Commit
cab28a47
authored
Sep 09, 2021
by
petitminion
Browse files
Merge branch 'playlist' of
https://dev.funkwhale.audio/petitminion/funkwhale
into playlist
parents
2830134a
c5d8470a
Pipeline
#16341
failed with stages
in 33 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
api/tests/playlists/test_utils.py
View file @
cab28a47
import
os
from
funkwhale_api.playlists
import
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"
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment