mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Add tests for template with non-ascii filenames
This is a test in response to #27262 but I could not provoke the error so it only shows that the current code is working with non-ascii filenames in this case. It doesn't show whether there's some other bug somewhere.
This commit is contained in:
parent
5dd8977cfa
commit
f91d961cb4
2 changed files with 19 additions and 0 deletions
|
@ -51,6 +51,24 @@
|
||||||
that:
|
that:
|
||||||
- "template_result.changed == true"
|
- "template_result.changed == true"
|
||||||
|
|
||||||
|
# Basic template with non-ascii names
|
||||||
|
- name: Check that non-ascii source and dest work
|
||||||
|
template:
|
||||||
|
src: 'café.j2'
|
||||||
|
dest: '{{ output_dir }}/café.txt'
|
||||||
|
register: template_results
|
||||||
|
|
||||||
|
- name: Check that the resulting file exists
|
||||||
|
stat:
|
||||||
|
path: '{{ output_dir }}/café.txt'
|
||||||
|
register: stat_results
|
||||||
|
|
||||||
|
- name: Check that template created the right file
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- 'template_results is changed'
|
||||||
|
- 'stat_results.stat["exists"]'
|
||||||
|
|
||||||
# test for import with context on jinja-2.9 See https://github.com/ansible/ansible/issues/20494
|
# test for import with context on jinja-2.9 See https://github.com/ansible/ansible/issues/20494
|
||||||
- name: fill in a template using import with context ala issue 20494
|
- name: fill in a template using import with context ala issue 20494
|
||||||
template: src=import_with_context.j2 dest={{output_dir}}/import_with_context.templated mode=0644
|
template: src=import_with_context.j2 dest={{output_dir}}/import_with_context.templated mode=0644
|
||||||
|
|
1
test/integration/targets/template/templates/café.j2
Normal file
1
test/integration/targets/template/templates/café.j2
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{{ ansible_managed }}
|
Loading…
Reference in a new issue