summaryrefslogtreecommitdiff
path: root/test/integration/targets/uri/tasks/main.yml
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration/targets/uri/tasks/main.yml')
-rw-r--r--test/integration/targets/uri/tasks/main.yml37
1 files changed, 35 insertions, 2 deletions
diff --git a/test/integration/targets/uri/tasks/main.yml b/test/integration/targets/uri/tasks/main.yml
index 9ba09ece..ddae83a0 100644
--- a/test/integration/targets/uri/tasks/main.yml
+++ b/test/integration/targets/uri/tasks/main.yml
@@ -132,7 +132,7 @@
- "result.changed == true"
- name: "get ca certificate {{ self_signed_host }}"
- get_url:
+ uri:
url: "http://{{ httpbin_host }}/ca2cert.pem"
dest: "{{ remote_tmp_dir }}/ca2cert.pem"
@@ -638,9 +638,18 @@
- assert:
that:
- result['set_cookie'] == 'Foo=bar, Baz=qux'
- # Python sorts cookies in order of most specific (ie. longest) path first
+ # Python 3.10 and earlier sorts cookies in order of most specific (ie. longest) path first
# items with the same path are reversed from response order
- result['cookies_string'] == 'Baz=qux; Foo=bar'
+ when: ansible_python_version is version('3.11', '<')
+
+- assert:
+ that:
+ - result['set_cookie'] == 'Foo=bar, Baz=qux'
+ # Python 3.11 no longer sorts cookies.
+ # See: https://github.com/python/cpython/issues/86232
+ - result['cookies_string'] == 'Foo=bar; Baz=qux'
+ when: ansible_python_version is version('3.11', '>=')
- name: Write out netrc template
template:
@@ -757,6 +766,30 @@
dest: "{{ remote_tmp_dir }}/output"
state: absent
+- name: Test download root to dir without content-disposition
+ uri:
+ url: "https://{{ httpbin_host }}/"
+ dest: "{{ remote_tmp_dir }}"
+ register: get_root_no_filename
+
+- name: Test downloading to dir without content-disposition
+ uri:
+ url: "https://{{ httpbin_host }}/response-headers"
+ dest: "{{ remote_tmp_dir }}"
+ register: get_dir_no_filename
+
+- name: Test downloading to dir with content-disposition
+ uri:
+ url: 'https://{{ httpbin_host }}/response-headers?Content-Disposition=attachment%3B%20filename%3D%22filename.json%22'
+ dest: "{{ remote_tmp_dir }}"
+ register: get_dir_filename
+
+- assert:
+ that:
+ - get_root_no_filename.path == remote_tmp_dir ~ "/index.html"
+ - get_dir_no_filename.path == remote_tmp_dir ~ "/response-headers"
+ - get_dir_filename.path == remote_tmp_dir ~ "/filename.json"
+
- name: Test follow_redirects=none
import_tasks: redirect-none.yml