mirror of
https://github.com/beetbox/beets.git
synced 2025-12-07 17:16:07 +01:00
add a test that would fail with the restricted whitelist approach
If no option is set, valid genres should not be rejected. Which is an argument to have a wide default whitelist.
This commit is contained in:
parent
35b6602795
commit
e399173f7e
1 changed files with 10 additions and 6 deletions
|
|
@ -36,19 +36,19 @@ class LastGenrePluginTest(unittest.TestCase):
|
|||
if whitelist:
|
||||
lastGenrePlugin.whitelist = whitelist
|
||||
|
||||
def test_c14n(self):
|
||||
"""Resolve genres that belong to a canonicalization branch.
|
||||
def test_defaults(self):
|
||||
"""Tests whitelist and c14n options with default filepaths
|
||||
"""
|
||||
# default whitelist and c14n
|
||||
self._setup_config(canonical=' ')
|
||||
self._setup_config(canonical='')
|
||||
self.assertEqual(lastGenrePlugin._resolve_genres(['delta blues']),
|
||||
'Blues')
|
||||
self.assertEqual(lastGenrePlugin._resolve_genres(['iota blues']), '')
|
||||
|
||||
# custom whitelist
|
||||
self._setup_config(canonical='', whitelist=set(['rock']))
|
||||
# default whitelist and no c14n
|
||||
self._setup_config()
|
||||
self.assertEqual(lastGenrePlugin._resolve_genres(['delta blues']),
|
||||
'')
|
||||
'delta blues')
|
||||
|
||||
def test_whitelist(self):
|
||||
"""Keep only genres that are in the whitelist.
|
||||
|
|
@ -58,6 +58,10 @@ class LastGenrePluginTest(unittest.TestCase):
|
|||
self.assertEqual(lastGenrePlugin._resolve_genres(['pop', 'blues']),
|
||||
'Blues')
|
||||
|
||||
self._setup_config(canonical='', whitelist=set(['rock']))
|
||||
self.assertEqual(lastGenrePlugin._resolve_genres(['delta blues']),
|
||||
'')
|
||||
|
||||
def test_count(self):
|
||||
"""Keep the n first genres, as we expect them to be sorted from more to
|
||||
less popular.
|
||||
|
|
|
|||
Loading…
Reference in a new issue