mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 04:09:16 +02:00
Fix #1105: Can now launch server import from the UI
This commit is contained in:
parent
0a93aec8c9
commit
788c12748f
17 changed files with 476 additions and 6 deletions
|
@ -1,5 +1,5 @@
|
|||
import os
|
||||
|
||||
import pathlib
|
||||
import pytest
|
||||
|
||||
from funkwhale_api.music import utils
|
||||
|
@ -91,3 +91,21 @@ def test_increment_downloads_count_already_tracked(
|
|||
|
||||
assert upload.downloads_count == 0
|
||||
assert upload.track.downloads_count == 0
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"path,expected",
|
||||
[
|
||||
("", [{"name": "Magic", "dir": True}, {"name": "System", "dir": True}]),
|
||||
("Magic", [{"name": "file.mp3", "dir": False}]),
|
||||
("System", [{"name": "file.ogg", "dir": False}]),
|
||||
],
|
||||
)
|
||||
def test_get_dirs_and_files(path, expected, tmpdir):
|
||||
root_path = pathlib.Path(tmpdir)
|
||||
(root_path / "Magic").mkdir()
|
||||
(root_path / "Magic" / "file.mp3").touch()
|
||||
(root_path / "System").mkdir()
|
||||
(root_path / "System" / "file.ogg").touch()
|
||||
|
||||
assert utils.browse_dir(root_path, path) == expected
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue