mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-06-30 07:50:43 +00:00
urldecode filter for Jinja2 (#28503)
* urldecode filter for Jinja2 We needed this in order to deconstruct correct URLs using Jinja2. And we might as well upstream this. * Add integration tests * Fixes for Python 3 * Add urlencode for older Jinja2
This commit is contained in:
parent
3b49bbcfde
commit
f45c41ef3e
2 changed files with 82 additions and 0 deletions
|
|
@ -169,6 +169,19 @@
|
|||
- _bad_urlsplit_filter is failed
|
||||
- "'unknown URL component' in _bad_urlsplit_filter.msg"
|
||||
|
||||
- name: Test urldecode filter
|
||||
set_fact:
|
||||
urldecoded_string: key="@{}é&%£ foo bar '(;\<>""°)
|
||||
|
||||
- name: Test urlencode filter
|
||||
set_fact:
|
||||
urlencoded_string: '{{ urldecoded_string|urlencode }}'
|
||||
|
||||
- name: Verify urlencode en urldecode
|
||||
assert:
|
||||
that:
|
||||
- urldecoded_string == urlencoded_string|urldecode
|
||||
|
||||
- name: Flatten tests
|
||||
block:
|
||||
- name: use flatten
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue