Update _setup_config

Give an empty string to obtain default whitelist, None for no whitelist
or a stringlist for a custom one.
This commit is contained in:
Fabrice Laporte 2014-04-27 22:31:31 +02:00
parent 0b3c5ddbe0
commit 0613cb7d13

View file

@ -27,11 +27,11 @@ lastGenrePlugin = lastgenre.LastGenrePlugin()
class LastGenrePluginTest(unittest.TestCase):
def _setup_config(self, whitelist=set(), canonical=None, count=1):
def _setup_config(self, whitelist=None, canonical=None, count=1):
config['lastgenre']['canonical'] = canonical
config['lastgenre']['count'] = count
config['lastgenre']['whitelist'] = \
os.path.join(os.path.dirname(lastgenre.__file__), 'genres.txt')
if whitelist == '':
config['lastgenre']['whitelist'] = whitelist
lastGenrePlugin.setup()
if whitelist:
lastGenrePlugin.whitelist = whitelist