Skip to content

Commit

Permalink
Add more tests for EmPy template expansion
Browse files Browse the repository at this point in the history
The 'positive' case was previously completely uncovered on Windows, and
there was also no test asserting that the caching mechanism respected
differing input variables.
  • Loading branch information
cottsay committed Sep 6, 2024
1 parent f9072e8 commit 8b21094
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/test_shell_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,17 @@ def test_expand_template():
f" processing template '{template_path}'")
assert not destination_path.exists()

# proper use
expand_template(template_path, destination_path, {'var': 'value1'})
assert destination_path.exists()
assert destination_path.read_text() == 'value1'
# overwrite with a different value
expand_template(template_path, destination_path, {'var': 'value2'})
assert destination_path.exists()
assert destination_path.read_text() == 'value2'

destination_path.unlink()

# skip all symlink tests on Windows for now
if sys.platform == 'win32': # pragma: no cover
return
Expand Down

0 comments on commit 8b21094

Please sign in to comment.