Browse Source

Use a placeholder for the package folder

pull/120/head
Oliverpool 9 years ago
parent
commit
366dbd5d7a
  1. 4
      test/test_compilation/subdir.tex.control
  2. 9
      test/test_compilation/test_compilation.py

4
test/test_compilation/subdir.tex.control

@ -16,7 +16,7 @@
{@TEST_FOLDER@/subdir_datadir/latex/} % {@TEST_FOLDER@/subdir_datadir/latex/} %
{@TEST_FOLDER@/subdir_datadir2/latex/} % {@TEST_FOLDER@/subdir_datadir2/latex/} %
{@TEST_FOLDER@/latex/} % {@TEST_FOLDER@/latex/} %
{/home/travis/build/patacrep/patacrep/patacrep/data/latex/} % {@PACKAGE_FOLDER@/data/latex/} %
} }
\makeatother \makeatother
@ -45,7 +45,7 @@ guitar,
{@TEST_FOLDER@/subdir_datadir/} % {@TEST_FOLDER@/subdir_datadir/} %
{@TEST_FOLDER@/subdir_datadir2/} % {@TEST_FOLDER@/subdir_datadir2/} %
{@TEST_FOLDER@/} % {@TEST_FOLDER@/} %
{/home/travis/build/patacrep/patacrep/patacrep/data/} % {@PACKAGE_FOLDER@/data/} %
} }

9
test/test_compilation/test_compilation.py

@ -90,8 +90,15 @@ class FileTest(unittest.TestCase, metaclass=dynamic.DynamicTest):
) )
def assertMultiLineEqual(self, result, expected): def assertMultiLineEqual(self, result, expected):
"""Replace the paths with the local paths""" """Replace the placeholder paths with the local paths"""
placeholder = "@TEST_FOLDER@" placeholder = "@TEST_FOLDER@"
localpath = os.path.dirname(__file__) localpath = os.path.dirname(__file__)
expected = expected.replace(placeholder, localpath) 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) return super().assertMultiLineEqual(result, expected)

Loading…
Cancel
Save