Skip to content
Snippets Groups Projects
Commit 30e7f369 authored by Karl-Hermann Wieners's avatar Karl-Hermann Wieners
Browse files

Added tests for global function 'get_file' (see r421)

parent b3cccd95
No related branches found
No related tags found
No related merge requests found
...@@ -496,6 +496,53 @@ class WordwrapTestCase(MkexpSimpleTestCase): ...@@ -496,6 +496,53 @@ class WordwrapTestCase(MkexpSimpleTestCase):
tlike-message tlike-message
""") """)
class FilesTestCase(MkexpSimpleTestCase):
def test_get_file_simple(self):
self.run_test("""
%{get_file(files, 'target.txt')}
%{get_file(files, 'broken.txt')}
""", """
source.txt
.
""", """
[files]
target.txt = source.txt
broken.txt = .
""")
def test_get_file_path(self):
self.run_test("""
%{get_file(files, 'target.txt')}
%{get_file(files, 'path.txt')}
%{get_file(files.subdir, 'target.txt')}
""", """
/path/to/source/source.txt
/just/this/one/source.txt
/path/to/source/subdir/source.txt
""", """
[files]
.base_dir = /path/to/source
target.txt = source.txt
path.txt = /just/this/one/source.txt
[[subdir]]
.sub_dir = subdir
target.txt = source.txt
""")
def test_get_file_variable(self):
self.run_test("""
%{get_file(files, 'target.txt')}
%{get_file(files, 'broken.txt')}
""", """
source.txt
$BASENAME.txt
""", """
BASENAME = source
[files]
target.txt = $${BASENAME}.txt
broken.txt = $$BASENAME.txt
""")
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment