mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
fix for when status codes are provided as a comma separated list (#38080)
* fix for when status codes are provided as an array of strings * convert status codes to int, additional tests
This commit is contained in:
parent
85d5901b31
commit
c38617a736
2 changed files with 45 additions and 1 deletions
|
@ -252,6 +252,7 @@
|
|||
url: http://{{httpbin_host}}/status/202
|
||||
status_code:
|
||||
- 202
|
||||
- 418
|
||||
method: POST
|
||||
body: foo
|
||||
register: status_code_check
|
||||
|
@ -359,3 +360,35 @@
|
|||
- post_request_with_custom_headers.json.headers['Content-Type'] == "application/json"
|
||||
- post_request_with_custom_headers.json.headers['Test-Header'] == 'hello'
|
||||
- post_request_with_custom_headers.json.headers['Another-Header'] == 'world'
|
||||
|
||||
- name: validate status codes as list of strings
|
||||
win_uri:
|
||||
url: https://httpbin.org/status/202
|
||||
status_code:
|
||||
- '202'
|
||||
- '418'
|
||||
method: POST
|
||||
body: foo
|
||||
return_content: yes
|
||||
register: request_status_code_string
|
||||
|
||||
- name: assert status codes as list of strings
|
||||
assert:
|
||||
that:
|
||||
- not request_status_code_string.changed
|
||||
- request_status_code_string.status_code == 202
|
||||
|
||||
- name: validate status codes as comma separated list
|
||||
win_uri:
|
||||
url: https://httpbin.org/status/202
|
||||
status_code: 202, 418
|
||||
method: POST
|
||||
body: foo
|
||||
return_content: yes
|
||||
register: request_status_code_comma
|
||||
|
||||
- name: assert status codes as comma separated list
|
||||
assert:
|
||||
that:
|
||||
- not request_status_code_comma.changed
|
||||
- request_status_code_comma.status_code == 202
|
Loading…
Add table
Add a link
Reference in a new issue