From 771fb0e905a0f1771b3cbc79c006ff33b909cd1e Mon Sep 17 00:00:00 2001 From: Oliverpool Date: Thu, 17 Dec 2015 16:52:06 +0100 Subject: [PATCH] Let test_content aside while debugging --- test/{test_content => ttest_content}/__init__.py | 0 test/{test_content => ttest_content}/cwd.control | 0 test/{test_content => ttest_content}/cwd.source | 0 .../{test_content => ttest_content}/cwd_list.control | 0 test/{test_content => ttest_content}/cwd_list.source | 0 .../datadir/custom_list.json | 0 .../datadir/songs/chordpro.csg | 0 .../datadir/songs/exsong.sg | 0 .../datadir/songs/intersong.is | 0 .../datadir/songs/jsonlist.json | 0 .../datadir/songs/subdir/chordpro.csg | 0 .../datadir/songs/texfile.tex | 0 .../datadir/songs/texsong.tsg | 0 test/{test_content => ttest_content}/glob.control | 0 test/{test_content => ttest_content}/glob.source | 0 test/{test_content => ttest_content}/include.control | 0 test/{test_content => ttest_content}/include.source | 0 .../{test_content => ttest_content}/sections.control | 0 test/{test_content => ttest_content}/sections.source | 0 .../sections_short.control | 0 .../sections_short.source | 0 test/{test_content => ttest_content}/songs.control | 0 test/{test_content => ttest_content}/songs.source | 0 .../songsection.control | 0 .../songsection.source | 0 test/{test_content => ttest_content}/sorted.control | 0 test/{test_content => ttest_content}/sorted.source | 0 test/{test_content => ttest_content}/test_content.py | 12 ++++++++++-- test/{test_content => ttest_content}/tex.control | 0 test/{test_content => ttest_content}/tex.source | 0 30 files changed, 10 insertions(+), 2 deletions(-) rename test/{test_content => ttest_content}/__init__.py (100%) rename test/{test_content => ttest_content}/cwd.control (100%) rename test/{test_content => ttest_content}/cwd.source (100%) rename test/{test_content => ttest_content}/cwd_list.control (100%) rename test/{test_content => ttest_content}/cwd_list.source (100%) rename test/{test_content => ttest_content}/datadir/custom_list.json (100%) rename test/{test_content => ttest_content}/datadir/songs/chordpro.csg (100%) rename test/{test_content => ttest_content}/datadir/songs/exsong.sg (100%) rename test/{test_content => ttest_content}/datadir/songs/intersong.is (100%) rename test/{test_content => ttest_content}/datadir/songs/jsonlist.json (100%) rename test/{test_content => ttest_content}/datadir/songs/subdir/chordpro.csg (100%) rename test/{test_content => ttest_content}/datadir/songs/texfile.tex (100%) rename test/{test_content => ttest_content}/datadir/songs/texsong.tsg (100%) rename test/{test_content => ttest_content}/glob.control (100%) rename test/{test_content => ttest_content}/glob.source (100%) rename test/{test_content => ttest_content}/include.control (100%) rename test/{test_content => ttest_content}/include.source (100%) rename test/{test_content => ttest_content}/sections.control (100%) rename test/{test_content => ttest_content}/sections.source (100%) rename test/{test_content => ttest_content}/sections_short.control (100%) rename test/{test_content => ttest_content}/sections_short.source (100%) rename test/{test_content => ttest_content}/songs.control (100%) rename test/{test_content => ttest_content}/songs.source (100%) rename test/{test_content => ttest_content}/songsection.control (100%) rename test/{test_content => ttest_content}/songsection.source (100%) rename test/{test_content => ttest_content}/sorted.control (100%) rename test/{test_content => ttest_content}/sorted.source (100%) rename test/{test_content => ttest_content}/test_content.py (90%) rename test/{test_content => ttest_content}/tex.control (100%) rename test/{test_content => ttest_content}/tex.source (100%) diff --git a/test/test_content/__init__.py b/test/ttest_content/__init__.py similarity index 100% rename from test/test_content/__init__.py rename to test/ttest_content/__init__.py diff --git a/test/test_content/cwd.control b/test/ttest_content/cwd.control similarity index 100% rename from test/test_content/cwd.control rename to test/ttest_content/cwd.control diff --git a/test/test_content/cwd.source b/test/ttest_content/cwd.source similarity index 100% rename from test/test_content/cwd.source rename to test/ttest_content/cwd.source diff --git a/test/test_content/cwd_list.control b/test/ttest_content/cwd_list.control similarity index 100% rename from test/test_content/cwd_list.control rename to test/ttest_content/cwd_list.control diff --git a/test/test_content/cwd_list.source b/test/ttest_content/cwd_list.source similarity index 100% rename from test/test_content/cwd_list.source rename to test/ttest_content/cwd_list.source diff --git a/test/test_content/datadir/custom_list.json b/test/ttest_content/datadir/custom_list.json similarity index 100% rename from test/test_content/datadir/custom_list.json rename to test/ttest_content/datadir/custom_list.json diff --git a/test/test_content/datadir/songs/chordpro.csg b/test/ttest_content/datadir/songs/chordpro.csg similarity index 100% rename from test/test_content/datadir/songs/chordpro.csg rename to test/ttest_content/datadir/songs/chordpro.csg diff --git a/test/test_content/datadir/songs/exsong.sg b/test/ttest_content/datadir/songs/exsong.sg similarity index 100% rename from test/test_content/datadir/songs/exsong.sg rename to test/ttest_content/datadir/songs/exsong.sg diff --git a/test/test_content/datadir/songs/intersong.is b/test/ttest_content/datadir/songs/intersong.is similarity index 100% rename from test/test_content/datadir/songs/intersong.is rename to test/ttest_content/datadir/songs/intersong.is diff --git a/test/test_content/datadir/songs/jsonlist.json b/test/ttest_content/datadir/songs/jsonlist.json similarity index 100% rename from test/test_content/datadir/songs/jsonlist.json rename to test/ttest_content/datadir/songs/jsonlist.json diff --git a/test/test_content/datadir/songs/subdir/chordpro.csg b/test/ttest_content/datadir/songs/subdir/chordpro.csg similarity index 100% rename from test/test_content/datadir/songs/subdir/chordpro.csg rename to test/ttest_content/datadir/songs/subdir/chordpro.csg diff --git a/test/test_content/datadir/songs/texfile.tex b/test/ttest_content/datadir/songs/texfile.tex similarity index 100% rename from test/test_content/datadir/songs/texfile.tex rename to test/ttest_content/datadir/songs/texfile.tex diff --git a/test/test_content/datadir/songs/texsong.tsg b/test/ttest_content/datadir/songs/texsong.tsg similarity index 100% rename from test/test_content/datadir/songs/texsong.tsg rename to test/ttest_content/datadir/songs/texsong.tsg diff --git a/test/test_content/glob.control b/test/ttest_content/glob.control similarity index 100% rename from test/test_content/glob.control rename to test/ttest_content/glob.control diff --git a/test/test_content/glob.source b/test/ttest_content/glob.source similarity index 100% rename from test/test_content/glob.source rename to test/ttest_content/glob.source diff --git a/test/test_content/include.control b/test/ttest_content/include.control similarity index 100% rename from test/test_content/include.control rename to test/ttest_content/include.control diff --git a/test/test_content/include.source b/test/ttest_content/include.source similarity index 100% rename from test/test_content/include.source rename to test/ttest_content/include.source diff --git a/test/test_content/sections.control b/test/ttest_content/sections.control similarity index 100% rename from test/test_content/sections.control rename to test/ttest_content/sections.control diff --git a/test/test_content/sections.source b/test/ttest_content/sections.source similarity index 100% rename from test/test_content/sections.source rename to test/ttest_content/sections.source diff --git a/test/test_content/sections_short.control b/test/ttest_content/sections_short.control similarity index 100% rename from test/test_content/sections_short.control rename to test/ttest_content/sections_short.control diff --git a/test/test_content/sections_short.source b/test/ttest_content/sections_short.source similarity index 100% rename from test/test_content/sections_short.source rename to test/ttest_content/sections_short.source diff --git a/test/test_content/songs.control b/test/ttest_content/songs.control similarity index 100% rename from test/test_content/songs.control rename to test/ttest_content/songs.control diff --git a/test/test_content/songs.source b/test/ttest_content/songs.source similarity index 100% rename from test/test_content/songs.source rename to test/ttest_content/songs.source diff --git a/test/test_content/songsection.control b/test/ttest_content/songsection.control similarity index 100% rename from test/test_content/songsection.control rename to test/ttest_content/songsection.control diff --git a/test/test_content/songsection.source b/test/ttest_content/songsection.source similarity index 100% rename from test/test_content/songsection.source rename to test/ttest_content/songsection.source diff --git a/test/test_content/sorted.control b/test/ttest_content/sorted.control similarity index 100% rename from test/test_content/sorted.control rename to test/ttest_content/sorted.control diff --git a/test/test_content/sorted.source b/test/ttest_content/sorted.source similarity index 100% rename from test/test_content/sorted.source rename to test/ttest_content/sorted.source diff --git a/test/test_content/test_content.py b/test/ttest_content/test_content.py similarity index 90% rename from test/test_content/test_content.py rename to test/ttest_content/test_content.py index 5857506c..92d8ec1c 100644 --- a/test/test_content/test_content.py +++ b/test/ttest_content/test_content.py @@ -7,8 +7,10 @@ import os import unittest import json +import yaml + from patacrep.songs import DataSubpath, DEFAULT_CONFIG -from patacrep import content, files +from patacrep import content, encoding, files, pkg_datapath from patacrep.content import song, section, songsection, tex from .. import logging_reduced @@ -95,10 +97,16 @@ class FileTest(unittest.TestCase, metaclass=dynamic.DynamicTest): def _generate_config(cls): """Generate the config to process the content""" - config = DEFAULT_CONFIG.copy() + # Load the default songbook config + default_songbook_path = pkg_datapath('templates', 'default_songbook.sb.yml') + with encoding.open_read(default_songbook_path) as default_songbook_file: + config = yaml.load(default_songbook_file) + + #config = DEFAULT_CONFIG.copy() datadirpaths = [os.path.join(os.path.dirname(__file__), 'datadir')] + # todo : yaml and testing? config['datadir'] = datadirpaths config['_songdir'] = [ diff --git a/test/test_content/tex.control b/test/ttest_content/tex.control similarity index 100% rename from test/test_content/tex.control rename to test/ttest_content/tex.control diff --git a/test/test_content/tex.source b/test/ttest_content/tex.source similarity index 100% rename from test/test_content/tex.source rename to test/ttest_content/tex.source