|
@ -2,8 +2,6 @@ |
|
|
|
|
|
|
|
|
# pylint: disable=too-few-public-methods |
|
|
# pylint: disable=too-few-public-methods |
|
|
|
|
|
|
|
|
#pylint: skip-file |
|
|
|
|
|
|
|
|
|
|
|
import glob |
|
|
import glob |
|
|
import os |
|
|
import os |
|
|
import unittest |
|
|
import unittest |
|
@ -11,9 +9,10 @@ import json |
|
|
|
|
|
|
|
|
import yaml |
|
|
import yaml |
|
|
|
|
|
|
|
|
from patacrep.songs import DataSubpath, DEFAULT_CONFIG |
|
|
from patacrep.songs import DataSubpath |
|
|
from patacrep import content, encoding, files, pkg_datapath |
|
|
from patacrep import content, encoding, files, pkg_datapath |
|
|
from patacrep.content import song, section, songsection, tex |
|
|
from patacrep.content import song, section, songsection, tex |
|
|
|
|
|
from patacrep.build import config_model |
|
|
|
|
|
|
|
|
from .. import logging_reduced |
|
|
from .. import logging_reduced |
|
|
from .. import dynamic # pylint: disable=unused-import |
|
|
from .. import dynamic # pylint: disable=unused-import |
|
@ -35,7 +34,6 @@ class FileTest(unittest.TestCase, metaclass=dynamic.DynamicTest): |
|
|
|
|
|
|
|
|
@classmethod |
|
|
@classmethod |
|
|
def _iter_testmethods(cls): |
|
|
def _iter_testmethods(cls): |
|
|
return |
|
|
|
|
|
"""Iterate over dynamically generated test methods""" |
|
|
"""Iterate over dynamically generated test methods""" |
|
|
for source in sorted(glob.glob(os.path.join( |
|
|
for source in sorted(glob.glob(os.path.join( |
|
|
os.path.dirname(__file__), |
|
|
os.path.dirname(__file__), |
|
@ -101,14 +99,12 @@ class FileTest(unittest.TestCase, metaclass=dynamic.DynamicTest): |
|
|
"""Generate the config to process the content""" |
|
|
"""Generate the config to process the content""" |
|
|
|
|
|
|
|
|
# Load the default songbook config |
|
|
# Load the default songbook config |
|
|
default_songbook_path = pkg_datapath('templates', 'default_songbook.sb.yml') |
|
|
config = config_model('default') |
|
|
with encoding.open_read(default_songbook_path) as default_songbook_file: |
|
|
|
|
|
config = yaml.load(default_songbook_file) |
|
|
|
|
|
|
|
|
|
|
|
datadirpaths = [os.path.join(os.path.dirname(__file__), 'datadir')] |
|
|
datadirpaths = [os.path.join(os.path.dirname(__file__), 'datadir')] |
|
|
|
|
|
|
|
|
# todo : yaml and testing? |
|
|
# todo : yaml and testing? |
|
|
config['datadir'] = datadirpaths |
|
|
config['_datadir'] = datadirpaths |
|
|
|
|
|
|
|
|
config['_songdir'] = [ |
|
|
config['_songdir'] = [ |
|
|
DataSubpath(path, 'songs') |
|
|
DataSubpath(path, 'songs') |
|
|