Added ordered hashes.
This commit is contained in:
parent
243ab902ab
commit
da070c862b
@ -17,10 +17,14 @@
|
||||
{{- '}\n' -}}
|
||||
{%- endif -%}
|
||||
{%- else -%}
|
||||
{%- if recurse > 0 -%}
|
||||
{{- '{\n' -}}
|
||||
{%- endif -%}
|
||||
{%- for item in data -%}
|
||||
{{- keepalived_config(item) -}}
|
||||
{%- endfor -%}
|
||||
{%- if recurse > 0 -%}
|
||||
{{- '}\n' -}}
|
||||
{%- endif -%}
|
||||
{%- endif -%}
|
||||
{%- endmacro -%}
|
||||
|
@ -54,5 +54,10 @@ class TestKeepalivedConfiguration(unittest.TestCase):
|
||||
result = 'friends {\nbarney rubble\nbetty rubble\nfred flintstone\nwilma flintstone\n}\n'
|
||||
self.renderTest(testdata, result)
|
||||
|
||||
def test_ordered_hashes(self):
|
||||
testdata = [{'fred': 'flintstone'}, {'wilma': 'flintstone'}, {'barney': 'rubble'}, {'betty': 'rubble'}]
|
||||
result = 'fred flintstone\nwilma flintstone\nbarney rubble\nbetty rubble\n'
|
||||
self.renderTest(testdata, result)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
Loading…
Reference in New Issue
Block a user