mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-27 10:40:22 -07:00
Add dict filter (#2171)
* Add dict and list_to_dict filters. * Remove list_to_dict filter. * Add myself as maintainer.
This commit is contained in:
parent
4b6722d938
commit
b6ae47c455
5 changed files with 38 additions and 0 deletions
2
tests/integration/targets/filter_dict/aliases
Normal file
2
tests/integration/targets/filter_dict/aliases
Normal file
|
@ -0,0 +1,2 @@
|
|||
shippable/posix/group3
|
||||
skip/python2.6 # filters are controller only, and we no longer support Python 2.6 on the controller
|
7
tests/integration/targets/filter_dict/tasks/main.yml
Normal file
7
tests/integration/targets/filter_dict/tasks/main.yml
Normal file
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
- name: "Test dict filter"
|
||||
assert:
|
||||
that:
|
||||
- "[['a', 'b']] | community.general.dict == dict([['a', 'b']])"
|
||||
- "[['a', 'b'], [1, 2]] | community.general.dict == dict([['a', 'b'], [1, 2]])"
|
||||
- "[] | community.general.dict == dict([])"
|
Loading…
Add table
Add a link
Reference in a new issue