From 6135ea8c3e483ff2e87134df48989db53ebd540d Mon Sep 17 00:00:00 2001 From: Oliverpool Date: Fri, 20 Nov 2015 13:49:22 +0100 Subject: [PATCH] Add test and correct cwd --- patacrep/content/cwd.py | 3 +-- test/test_content/cwd.control | 1 + test/test_content/cwd.source | 1 + test/test_content/cwd_list.control | 1 + test/test_content/cwd_list.source | 1 + 5 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 test/test_content/cwd.control create mode 100644 test/test_content/cwd.source create mode 100644 test/test_content/cwd_list.control create mode 100644 test/test_content/cwd_list.source diff --git a/patacrep/content/cwd.py b/patacrep/content/cwd.py index b4d9c2de..9ba6fddb 100755 --- a/patacrep/content/cwd.py +++ b/patacrep/content/cwd.py @@ -25,8 +25,7 @@ def parse(keyword, config, argument, contentlist): old_songdir = config['_songdir'] config['_songdir'] = ( [DataSubpath("", argument)] + - [path.clone().join(argument) for path in config['_songdir']] + - config['_songdir'] + [path.clone().join(argument) for path in config['_songdir']] ) processed_content = process_content(contentlist, config) config['_songdir'] = old_songdir diff --git a/test/test_content/cwd.control b/test/test_content/cwd.control new file mode 100644 index 00000000..c0a741d2 --- /dev/null +++ b/test/test_content/cwd.control @@ -0,0 +1 @@ +["subdir/chordpro.csg"] \ No newline at end of file diff --git a/test/test_content/cwd.source b/test/test_content/cwd.source new file mode 100644 index 00000000..4dfc53e6 --- /dev/null +++ b/test/test_content/cwd.source @@ -0,0 +1 @@ +[["cwd(subdir)"]] \ No newline at end of file diff --git a/test/test_content/cwd_list.control b/test/test_content/cwd_list.control new file mode 100644 index 00000000..c0a741d2 --- /dev/null +++ b/test/test_content/cwd_list.control @@ -0,0 +1 @@ +["subdir/chordpro.csg"] \ No newline at end of file diff --git a/test/test_content/cwd_list.source b/test/test_content/cwd_list.source new file mode 100644 index 00000000..837f22eb --- /dev/null +++ b/test/test_content/cwd_list.source @@ -0,0 +1 @@ +[["cwd(subdir)", "exsong.sg", "intersong.is", "jsonlist.json", "texfile.tex", "texsong.tsg", "chordpro.csg", "subdir/chordpro.csg"]] \ No newline at end of file