PageRenderTime 19ms CodeModel.GetById 14ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/test/integration/roles/test_filters/files/foo.txt

https://github.com/ajanthanm/ansible
Plain Text | 72 lines | 45 code | 27 blank | 0 comment | 0 complexity | 2930891ed379ea056aa76427d24f41e0 MD5 | raw file
 1This is a test of various filter plugins found in Ansible (ex: core.py), and 
 2not so much a test of the core filters in Jinja2.
 3
 4Dumping a nested structure to JSON
 5
 6[
 7    "this is a list element", 
 8    {
 9        "this": "is a hash element in a list", 
10        "warp": 9, 
11        "where": "endor"
12    }
13]
14
15Dumping the same structure to YAML
16
17- this is a list element
18-   this: is a hash element in a list
19    warp: 9
20    where: endor
21
22
23Dumping the same structure to JSON, but don't pretty print
24
25["this is a list element", {"this": "is a hash element in a list", "where": "endor", "warp": 9}]
26
27Dumping the same structure to YAML, but don't pretty print
28
29- this is a list element
30- {this: is a hash element in a list, warp: 9, where: endor}
31
32
33From a recorded task, the changed, failed, success, and skipped
34filters are shortcuts to ask if those tasks produced changes, failed,
35succeeded, or skipped (as one might guess).
36
37Changed = True
38Failed  = False
39Success = True
40Skipped = False
41
42The mandatory filter fails if a variable is not defined and returns the value.
43To avoid breaking this test, this variable is already defined.
44
45a = 1
46
47There are various casts available
48
49int = 1
50bool = True
51
52String quoting
53
54quoted = quoted
55
56The fileglob module returns the list of things matching a pattern.
57
58fileglob = []
59
60There are also various string operations that work on paths.  These do not require
61files to exist and are passthrus to the python os.path functions
62
63/etc/motd with basename = motd
64/etc/motd with dirname  = /etc
65
66TODO: realpath follows symlinks.  There isn't a test for this just now.
67
68TODO: add tests for set theory operations like union
69
70TODO: add tests for regex, match, and search
71
72