test(saltcheck): test for `commented` and not `commented`

This commit is contained in:
Imran Iqbal 2019-10-17 19:49:00 +01:00
parent 007970f935
commit 50706119fa
No known key found for this signature in database
GPG Key ID: 6D8629439D2B7819
2 changed files with 6 additions and 4 deletions

View File

@ -20,7 +20,7 @@ cron.{{ task }}:
- {{ section }}: '{{ task_options.get(section) }}' - {{ section }}: '{{ task_options.get(section) }}'
{%- endif %} {%- endif %}
{%- endfor %} {%- endfor %}
{%- if 'commented' in task_options and task_options.commented %} {%- if task_options.commented|d(False) %}
- commented: True - commented: True
{%- endif %} {%- endif %}
{%- endfor %} {%- endfor %}

View File

@ -44,16 +44,18 @@ validate_cron.{{ task }}_{{ section }}:
{%- endif %} {%- endif %}
{%- endfor %} {%- endfor %}
{%- if 'commented' in task_options and task_options.commented %} {%- set assertion = 'assertFalse' %}
{%- if task_options.commented|d(False) %}
{%- set assertion = 'assertTrue' %}
{%- endif %}
validate_cron.{{ task }}_commented: validate_cron.{{ task }}_commented:
module_and_function: cron.get_entry module_and_function: cron.get_entry
args: args:
- {{ task_options.user|d('root') }} - {{ task_options.user|d('root') }}
- {{ task }} - {{ task }}
assertion: assertTrue assertion: {{ assertion }}
assertion_section: commented assertion_section: commented
{%- endif %} {%- endif %}
{%- endif %}
{%- endfor %} {%- endfor %}
{%- endif %} {%- endif %}