Skip to content

Commit 38e371a

Browse files
committed
test: utils to check artist and album folder
1 parent f899d33 commit 38e371a

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

test/test_utils.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,25 @@ def test_file_name_string_suffix():
1010
assert FileUtil.equal_file_with_numeric_suffix("some_file.mp3", "some_file01.mp3") is True
1111
assert FileUtil.equal_file_with_numeric_suffix("some_file.mp3", "some_file 12.mp3") is True
1212
assert FileUtil.equal_file_with_numeric_suffix("some_file.mp3", "some_file 3.mp3") is True
13+
14+
15+
def test_is_artist_folder():
16+
"""Test the is_artist_folder functionality."""
17+
base_path = "/path/to/base"
18+
artist_path = "/path/to/base/artist_name"
19+
assert FileUtil.is_artist_folder(base_path, artist_path) is True
20+
artist_path = "/path/to/base/artist_name/album_name"
21+
assert FileUtil.is_artist_folder(base_path, artist_path) is False
22+
artist_path = "/path/to/other_base/artist_name"
23+
assert FileUtil.is_artist_folder(base_path, artist_path) is False
24+
25+
26+
def test_is_album_folder():
27+
"""Test the is_album_folder functionality."""
28+
base_path = "/path/to/base"
29+
album_path = "/path/to/base/artist_name/album_name"
30+
assert FileUtil.is_album_folder(base_path, album_path) is True
31+
album_path = "/path/to/base/artist_name"
32+
assert FileUtil.is_album_folder(base_path, album_path) is False
33+
album_path = "/path/to/other_base/artist_name/album_name"
34+
assert FileUtil.is_album_folder(base_path, album_path) is False

0 commit comments

Comments
 (0)