Debian Codegraph @

test/integration/targets/test_uri/tasks/main.yml

raw
1 - name: urX tests
2 vars:
3 special: ['http', 'https', 'ftp', 'ftps', 'ws', 'wss', 'file']
4 block:
5 - name: Assert uri tests
6 assert:
7 that:
8 - "'http://searchengine.tld' is uri" # simple case, urls are uris but not all uris are urls
9 - "'ftp://searchengine.tld' is uri" # other scheme
10 - "'file://etc/hosts' is uri"
11 - "'mailto://[email protected]' is uri"
12 - "'sftp://[email protected]' is uri"
13 - "'asldkfjhalsidfthjo' is uri" # junk can look like uri (either implied scheme or empty path)
14 - "'asldkfjhalsidfthjo' is not uri(special)" # validate against the schemes i know i need
15 - "'http://admin:[email protected]' is uri"
16 - "'ftps://admin:[email protected]' is uri"
17 - "'admin:[email protected]' is uri" # scheme is implied
18 - "'http://admin:[email protected]/myfile?param=1&param=2' is uri"
19 - "'urn:isbn:9780307476463' is uri" # book ref
20
21 - name: Assert url tests
22 assert:
23 that:
24 - "'http://searchengine.tld' is url" # simple case
25 - "'htp://searchengine.tld' is not url(special)" # bad scheme for explicit expectations
26 - "'htp://searchengine.tld' is url" # bad scheme, but valid if no explicit list
27 - "'ftp://searchengine.tld' is url"
28 - "'ftp://searchengine.tld' is url"
29 - "'ftp:// searchengine.tld' is url"
30 - "'file://etc/hosts' is url"
31 - "'mailto://[email protected]' is url"
32 - "'asldkfjhalsidfthjo' is not url" # junk
33 - "'http://admin:[email protected]' is url"
34 - "'ftps://admin:[email protected]' is url"
35 - "'admin:[email protected]' is not url"
36 - "'http://admin:[email protected]/myfile?param=1&param=2' is url"
37 - "'urn:isbn:9780307476463' is not url" # book ref
38 - name: assert urn
39 assert:
40 that:
41 - "'urn:isbn:9780307476463' is urn" # book ref
42 - "'ftps://admin:[email protected]' is not urn"
43 - "'admin:[email protected]' is not urn"