From ea1113d43d43fc62733b63e58c8a78997c408bdf Mon Sep 17 00:00:00 2001 From: Oliverpool Date: Mon, 16 Nov 2015 17:45:37 +0100 Subject: [PATCH] Improve latex tests --- test/test_song/greensleeves_latex.crlf.tsg | 1 + test/test_song/greensleeves_latex.crlf.tsg.source | 2 ++ test/test_song/greensleeves_latex.tsg | 1 + ...reensleeves.tsg.source => greensleeves_latex.tsg.source} | 0 test/test_song/test_parser.py | 6 +++++- 5 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 test/test_song/greensleeves_latex.crlf.tsg create mode 100644 test/test_song/greensleeves_latex.crlf.tsg.source create mode 100644 test/test_song/greensleeves_latex.tsg rename test/test_song/{greensleeves.tsg.source => greensleeves_latex.tsg.source} (100%) diff --git a/test/test_song/greensleeves_latex.crlf.tsg b/test/test_song/greensleeves_latex.crlf.tsg new file mode 100644 index 00000000..5c2c33e3 --- /dev/null +++ b/test/test_song/greensleeves_latex.crlf.tsg @@ -0,0 +1 @@ +\import{@TEST_FOLDER@/}{greensleeves_latex.crlf.tsg.source} \ No newline at end of file diff --git a/test/test_song/greensleeves_latex.crlf.tsg.source b/test/test_song/greensleeves_latex.crlf.tsg.source new file mode 100644 index 00000000..ff805290 --- /dev/null +++ b/test/test_song/greensleeves_latex.crlf.tsg.source @@ -0,0 +1,2 @@ +# This content will be overwritten with `greensleeves_latex.tsg.source` content +# with windows line endings (CRLF) - for testing purposes diff --git a/test/test_song/greensleeves_latex.tsg b/test/test_song/greensleeves_latex.tsg new file mode 100644 index 00000000..0edd8826 --- /dev/null +++ b/test/test_song/greensleeves_latex.tsg @@ -0,0 +1 @@ +\import{@TEST_FOLDER@/}{greensleeves_latex.tsg.source} \ No newline at end of file diff --git a/test/test_song/greensleeves.tsg.source b/test/test_song/greensleeves_latex.tsg.source similarity index 100% rename from test/test_song/greensleeves.tsg.source rename to test/test_song/greensleeves_latex.tsg.source diff --git a/test/test_song/test_parser.py b/test/test_song/test_parser.py index 11a8f30e..1f995df0 100644 --- a/test/test_song/test_parser.py +++ b/test/test_song/test_parser.py @@ -61,9 +61,13 @@ class FileTest(unittest.TestCase, metaclass=dynamic.DynamicTest): with open_read(destname) as expectfile: with disable_logging(): song = self.song_plugins[out_format][in_format](sourcename, self.config) + expected = expectfile.read().strip().replace( + "@TEST_FOLDER@", + files.path2posix(resource_filename(__name__, "")), + ) self.assertMultiLineEqual( song.render().strip(), - expectfile.read().strip(), + expected, ) @classmethod