Skip to content

Commit

Permalink
test(saltcheck): test for commented and not commented
Browse files Browse the repository at this point in the history
  • Loading branch information
myii committed Oct 17, 2019
1 parent 007970f commit 5070611
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cron/config/file.sls
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ cron.{{ task }}:
- {{ section }}: '{{ task_options.get(section) }}'
{%- endif %}
{%- endfor %}
{%- if 'commented' in task_options and task_options.commented %}
{%- if task_options.commented|d(False) %}
- commented: True
{%- endif %}
{%- endfor %}
Expand Down
8 changes: 5 additions & 3 deletions cron/saltcheck-tests/config.tst
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,17 @@ validate_cron.{{ task }}_{{ section }}:
{%- endif %}
{%- 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:
module_and_function: cron.get_entry
args:
- {{ task_options.user|d('root') }}
- {{ task }}
assertion: assertTrue
assertion: {{ assertion }}
assertion_section: commented
{%- endif %}
{%- endif %}

{%- endfor %}
Expand Down

0 comments on commit 5070611

Please sign in to comment.