|
@ -8,7 +8,9 @@ import os |
|
|
import unittest |
|
|
import unittest |
|
|
from pkg_resources import resource_filename |
|
|
from pkg_resources import resource_filename |
|
|
|
|
|
|
|
|
from patacrep import files |
|
|
import yaml |
|
|
|
|
|
|
|
|
|
|
|
from patacrep import files, pkg_datapath |
|
|
from patacrep.songs import DEFAULT_CONFIG |
|
|
from patacrep.songs import DEFAULT_CONFIG |
|
|
from patacrep.encoding import open_read |
|
|
from patacrep.encoding import open_read |
|
|
|
|
|
|
|
@ -74,13 +76,17 @@ class FileTest(unittest.TestCase, metaclass=dynamic.DynamicTest): |
|
|
def _iter_testmethods(cls): |
|
|
def _iter_testmethods(cls): |
|
|
"""Iterate over song files to test.""" |
|
|
"""Iterate over song files to test.""" |
|
|
# Setting datadir |
|
|
# Setting datadir |
|
|
cls.config = DEFAULT_CONFIG |
|
|
# Load the default songbook config |
|
|
if 'datadir' not in cls.config: |
|
|
default_songbook_path = pkg_datapath('templates', 'default_songbook.sb.yml') |
|
|
cls.config['datadir'] = [] |
|
|
with open_read(default_songbook_path) as default_songbook_file: |
|
|
cls.config['datadir'].append('datadir') |
|
|
cls.config = yaml.load(default_songbook_file) |
|
|
|
|
|
|
|
|
|
|
|
if '_datadir' not in cls.config: |
|
|
|
|
|
cls.config['_datadir'] = [] |
|
|
|
|
|
cls.config['_datadir'].append('datadir') |
|
|
|
|
|
|
|
|
cls.song_plugins = files.load_plugins( |
|
|
cls.song_plugins = files.load_plugins( |
|
|
datadirs=cls.config['datadir'], |
|
|
datadirs=cls.config['_datadir'], |
|
|
root_modules=['songs'], |
|
|
root_modules=['songs'], |
|
|
keyword='SONG_RENDERERS', |
|
|
keyword='SONG_RENDERERS', |
|
|
) |
|
|
) |
|
|