Skip to content

Commit 55ea8a5

Browse files
committed
lastgenre: Update tests
1 parent 1747c00 commit 55ea8a5

1 file changed

Lines changed: 22 additions & 2 deletions

File tree

test/plugins/test_lastgenre.py

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ def test_sort_by_depth(self):
338338
"album": None,
339339
"artist": None,
340340
},
341-
("any existing", "original fallback"),
341+
("Any Existing", "keep + original fallback, any"),
342342
),
343343
# 7.1 - Keep the original genre when force and keep_existing are on, and
344344
# whitelist is enabled, and genre is valid.
@@ -358,7 +358,7 @@ def test_sort_by_depth(self):
358358
"album": None,
359359
"artist": None,
360360
},
361-
("Jazz", "original fallback"),
361+
("Jazz", "keep + original fallback, whitelist"),
362362
),
363363
# 7.2 - Return the configured fallback when force is on but
364364
# keep_existing is not.
@@ -380,6 +380,26 @@ def test_sort_by_depth(self):
380380
},
381381
("fallback genre", "fallback"),
382382
),
383+
# 7.3 - Filter out genres that map to an empty string in tree when
384+
# keep_existing is enabled and no Last.fm results are found
385+
(
386+
{
387+
"force": True,
388+
"keep_existing": True,
389+
"source": "track",
390+
"whitelist": False,
391+
"fallback": "fallback genre",
392+
"canonical": True,
393+
"prefer_specific": False,
394+
},
395+
"blacklisted genre",
396+
{
397+
"track": None,
398+
"album": None,
399+
"artist": None,
400+
},
401+
("fallback genre", "fallback"),
402+
),
383403
# 8 - fallback to fallback if no original
384404
(
385405
{

0 commit comments

Comments
 (0)