summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/filter_urlsplit/tasks/main.yml
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration/targets/filter_urlsplit/tasks/main.yml')
-rw-r--r--test/integration/targets/filter_urlsplit/tasks/main.yml30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/integration/targets/filter_urlsplit/tasks/main.yml b/test/integration/targets/filter_urlsplit/tasks/main.yml
new file mode 100644
index 0000000..c3ff3ec
--- /dev/null
+++ b/test/integration/targets/filter_urlsplit/tasks/main.yml
@@ -0,0 +1,30 @@
+- debug:
+ var: "'http://mary:MySecret@www.acme.com:9000/dir/index.html?query=term#fragment' | urlsplit"
+ verbosity: 1
+ tags: debug
+
+- name: Test urlsplit filter
+ assert:
+ that:
+ - "'http://mary:MySecret@www.acme.com:9000/dir/index.html?query=term#fragment' | urlsplit('fragment') == 'fragment'"
+ - "'http://mary:MySecret@www.acme.com:9000/dir/index.html?query=term#fragment' | urlsplit('hostname') == 'www.acme.com'"
+ - "'http://mary:MySecret@www.acme.com:9000/dir/index.html?query=term#fragment' | urlsplit('netloc') == 'mary:MySecret@www.acme.com:9000'"
+ - "'http://mary:MySecret@www.acme.com:9000/dir/index.html?query=term#fragment' | urlsplit('path') == '/dir/index.html'"
+ - "'http://mary:MySecret@www.acme.com:9000/dir/index.html?query=term#fragment' | urlsplit('port') == 9000"
+ - "'http://mary:MySecret@www.acme.com:9000/dir/index.html?query=term#fragment' | urlsplit('query') == 'query=term'"
+ - "'http://mary:MySecret@www.acme.com:9000/dir/index.html?query=term#fragment' | urlsplit('scheme') == 'http'"
+ - "'http://mary:MySecret@www.acme.com:9000/dir/index.html?query=term#fragment' | urlsplit('username') == 'mary'"
+ - "'http://mary:MySecret@www.acme.com:9000/dir/index.html?query=term#fragment' | urlsplit('password') == 'MySecret'"
+ - "'http://mary:MySecret@www.acme.com:9000/dir/index.html?query=term#fragment' | urlsplit == { 'fragment': 'fragment', 'hostname': 'www.acme.com', 'netloc': 'mary:MySecret@www.acme.com:9000', 'password': 'MySecret', 'path': '/dir/index.html', 'port': 9000, 'query': 'query=term', 'scheme': 'http', 'username': 'mary' }"
+
+- name: Test urlsplit filter bad argument
+ debug:
+ var: "'http://www.acme.com:9000/dir/index.html' | urlsplit('bad_filter')"
+ register: _bad_urlsplit_filter
+ ignore_errors: yes
+
+- name: Verify urlsplit filter showed an error message
+ assert:
+ that:
+ - _bad_urlsplit_filter is failed
+ - "'unknown URL component' in _bad_urlsplit_filter.msg"