mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-28 07:31:23 -07:00
parent
bc99432f89
commit
eaa5e07b28
247 changed files with 7318 additions and 7375 deletions
|
@ -6,25 +6,25 @@
|
|||
- hosts: localhost
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: Call plugin
|
||||
set_fact:
|
||||
result1: "{{ query('community.general.random_pet', words=3) }}"
|
||||
result2: "{{ query('community.general.random_pet', length=3) }}"
|
||||
result3: "{{ query('community.general.random_pet', prefix='kubernetes') }}"
|
||||
result4: "{{ query('community.general.random_pet', separator='_') }}"
|
||||
result5: "{{ query('community.general.random_pet', words=2, length=6, prefix='kubernetes', separator='_') }}"
|
||||
- name: Call plugin
|
||||
set_fact:
|
||||
result1: "{{ query('community.general.random_pet', words=3) }}"
|
||||
result2: "{{ query('community.general.random_pet', length=3) }}"
|
||||
result3: "{{ query('community.general.random_pet', prefix='kubernetes') }}"
|
||||
result4: "{{ query('community.general.random_pet', separator='_') }}"
|
||||
result5: "{{ query('community.general.random_pet', words=2, length=6, prefix='kubernetes', separator='_') }}"
|
||||
|
||||
- name: Check results
|
||||
assert:
|
||||
that:
|
||||
- result1 | length == 1
|
||||
- result1[0].split('-') | length == 3
|
||||
- result2 | length == 1
|
||||
- result2[0].split('-')[0] | length <= 3
|
||||
- result3 | length == 1
|
||||
- result3[0].split('-')[0] == 'kubernetes'
|
||||
- result4 | length == 1
|
||||
- result4[0].split('_') | length == 2
|
||||
- result5 | length == 1
|
||||
- result5[0].split('_') | length == 3
|
||||
- result5[0].split('_')[0] == 'kubernetes'
|
||||
- name: Check results
|
||||
assert:
|
||||
that:
|
||||
- result1 | length == 1
|
||||
- result1[0].split('-') | length == 3
|
||||
- result2 | length == 1
|
||||
- result2[0].split('-')[0] | length <= 3
|
||||
- result3 | length == 1
|
||||
- result3[0].split('-')[0] == 'kubernetes'
|
||||
- result4 | length == 1
|
||||
- result4[0].split('_') | length == 2
|
||||
- result5 | length == 1
|
||||
- result5[0].split('_') | length == 3
|
||||
- result5[0].split('_')[0] == 'kubernetes'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue