0
0
mirror of https://github.com/saltstack-formulas/cron-formula.git synced 2025-07-21 00:08:23 +02:00

style(config.tst): rearrange Jinja statements for clarity

This commit is contained in:
Imran Iqbal 2019-10-14 15:45:27 +01:00
parent aada0ae835
commit 8abec548c1
No known key found for this signature in database
GPG Key ID: 6D8629439D2B7819
2 changed files with 21 additions and 21 deletions

View File

@ -6,7 +6,7 @@
{%- from tplroot ~ "/map.jinja" import cron with context %} {%- from tplroot ~ "/map.jinja" import cron with context %}
{%- if 'tasks' in cron %} {%- if 'tasks' in cron %}
{%- for task,task_options in cron.tasks.items() %} {%- for task, task_options in cron.tasks.items() %}
cron.{{ task }}: cron.{{ task }}:
cron.{{ task_options.type|default('present') }}: cron.{{ task_options.type|default('present') }}:

View File

@ -4,9 +4,9 @@
{%- from "cron/saltcheck-tests/map.jinja" import cron with context %} {%- from "cron/saltcheck-tests/map.jinja" import cron with context %}
{%- if 'tasks' in cron %} {%- if 'tasks' in cron %}
{%- for task,task_options in cron.tasks.items() %} {%- for task, task_options in cron.tasks.items() %}
{%- if task_options.type == 'present' %} {%- if task_options.type == 'present' %}
validate_cron.{{ task }}_exists: validate_cron.{{ task }}_exists:
module_and_function: cron.get_entry module_and_function: cron.get_entry
args: args:
@ -16,7 +16,7 @@ validate_cron.{{ task }}_exists:
assertion_section: identifier assertion_section: identifier
expected-return: {{ task }} expected-return: {{ task }}
{%- if 'minute' in task_options %} {%- if 'minute' in task_options %}
validate_cron.{{ task }}_minute: validate_cron.{{ task }}_minute:
module_and_function: cron.get_entry module_and_function: cron.get_entry
args: args:
@ -25,9 +25,9 @@ validate_cron.{{ task }}_minute:
assertion: assertEqual assertion: assertEqual
assertion_section: minute assertion_section: minute
expected-return: '{{ task_options.minute }}' expected-return: '{{ task_options.minute }}'
{%- endif %} {%- endif %}
{%- if 'hour' in task_options %} {%- if 'hour' in task_options %}
validate_cron.{{ task }}_hour: validate_cron.{{ task }}_hour:
module_and_function: cron.get_entry module_and_function: cron.get_entry
args: args:
@ -36,9 +36,9 @@ validate_cron.{{ task }}_hour:
assertion_section: hour assertion_section: hour
assertion: assertEqual assertion: assertEqual
expected-return: '{{ task_options.hour }}' expected-return: '{{ task_options.hour }}'
{%- endif %} {%- endif %}
{%- if 'daymonth' in task_options %} {%- if 'daymonth' in task_options %}
validate_cron.{{ task }}_daymonth: validate_cron.{{ task }}_daymonth:
module_and_function: cron.get_entry module_and_function: cron.get_entry
args: args:
@ -47,9 +47,9 @@ validate_cron.{{ task }}_daymonth:
assertion_section: daymonth assertion_section: daymonth
assertion: assertEqual assertion: assertEqual
expected-return: '{{ task_options.daymonth }}' expected-return: '{{ task_options.daymonth }}'
{%- endif %} {%- endif %}
{%- if 'month' in task_options %} {%- if 'month' in task_options %}
validate_cron.{{ task }}_month: validate_cron.{{ task }}_month:
module_and_function: cron.get_entry module_and_function: cron.get_entry
args: args:
@ -58,9 +58,9 @@ validate_cron.{{ task }}_month:
assertion_section: month assertion_section: month
assertion: assertEqual assertion: assertEqual
expected-return: '{{ task_options.month }}' expected-return: '{{ task_options.month }}'
{%- endif %} {%- endif %}
{%- if 'dayweek' in task_options %} {%- if 'dayweek' in task_options %}
validate_cron.{{ task }}_dayweek: validate_cron.{{ task }}_dayweek:
module_and_function: cron.get_entry module_and_function: cron.get_entry
args: args:
@ -69,9 +69,9 @@ validate_cron.{{ task }}_dayweek:
assertion_section: dayweek assertion_section: dayweek
assertion: assertEqual assertion: assertEqual
expected-return: '{{ task_options.dayweek }}' expected-return: '{{ task_options.dayweek }}'
{%- endif %} {%- endif %}
{%- if 'comment' in task_options %} {%- if 'comment' in task_options %}
validate_cron.{{ task }}_comment: validate_cron.{{ task }}_comment:
module_and_function: cron.get_entry module_and_function: cron.get_entry
args: args:
@ -80,9 +80,9 @@ validate_cron.{{ task }}_comment:
assertion_section: comment assertion_section: comment
assertion: assertEqual assertion: assertEqual
expected-return: {{ task_options.comment }} expected-return: {{ task_options.comment }}
{%- endif %} {%- endif %}
{%- if 'commented' in task_options and task_options.commented %} {%- if 'commented' in task_options and task_options.commented %}
validate_cron.{{ task }}_commented: validate_cron.{{ task }}_commented:
module_and_function: cron.get_entry module_and_function: cron.get_entry
args: args:
@ -90,17 +90,17 @@ validate_cron.{{ task }}_commented:
- {{ task }} - {{ task }}
assertion_section: commented assertion_section: commented
assertion: assertTrue assertion: assertTrue
{%- endif %} {%- endif %}
{%- endif %} {%- endif %}
{%- if task_options.type == 'absent' %} {%- if task_options.type == 'absent' %}
validate_cron.{{ task }}_absent: validate_cron.{{ task }}_absent:
module_and_function: cron.get_entry module_and_function: cron.get_entry
args: args:
- {{ task_options.user|default('root') }} - {{ task_options.user|default('root') }}
- {{ task }} - {{ task }}
assertion: assertFalse assertion: assertFalse
{%- endif %} {%- endif %}
{%- endfor %} {%- endfor %}
{%- endif %} {%- endif %}