From 366dbd5d7ab5c1f7fbdde8d98f568af917f54d5c Mon Sep 17 00:00:00 2001 From: Oliverpool Date: Thu, 22 Oct 2015 15:30:02 +0200 Subject: [PATCH] Use a placeholder for the package folder --- test/test_compilation/subdir.tex.control | 4 ++-- test/test_compilation/test_compilation.py | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/test/test_compilation/subdir.tex.control b/test/test_compilation/subdir.tex.control index f3374e33..32656938 100644 --- a/test/test_compilation/subdir.tex.control +++ b/test/test_compilation/subdir.tex.control @@ -16,7 +16,7 @@ {@TEST_FOLDER@/subdir_datadir/latex/} % {@TEST_FOLDER@/subdir_datadir2/latex/} % {@TEST_FOLDER@/latex/} % - {/home/travis/build/patacrep/patacrep/patacrep/data/latex/} % + {@PACKAGE_FOLDER@/data/latex/} % } \makeatother @@ -45,7 +45,7 @@ guitar, {@TEST_FOLDER@/subdir_datadir/} % {@TEST_FOLDER@/subdir_datadir2/} % {@TEST_FOLDER@/} % - {/home/travis/build/patacrep/patacrep/patacrep/data/} % + {@PACKAGE_FOLDER@/data/} % } diff --git a/test/test_compilation/test_compilation.py b/test/test_compilation/test_compilation.py index 159a821b..8d605c86 100644 --- a/test/test_compilation/test_compilation.py +++ b/test/test_compilation/test_compilation.py @@ -90,8 +90,15 @@ class FileTest(unittest.TestCase, metaclass=dynamic.DynamicTest): ) def assertMultiLineEqual(self, result, expected): - """Replace the paths with the local paths""" + """Replace the placeholder paths with the local paths""" + placeholder = "@TEST_FOLDER@" localpath = os.path.dirname(__file__) expected = expected.replace(placeholder, localpath) + + import patacrep + placeholder = "@PACKAGE_FOLDER@" + localpath = os.path.dirname(patacrep.__file__) + expected = expected.replace(placeholder, localpath) + return super().assertMultiLineEqual(result, expected)