Skip to content

Commit

Permalink
test helper unit tests: reformat YAML files
Browse files Browse the repository at this point in the history
  • Loading branch information
russoz committed Feb 1, 2025
1 parent 5f157aa commit c1550c7
Show file tree
Hide file tree
Showing 13 changed files with 1,611 additions and 1,611 deletions.
786 changes: 393 additions & 393 deletions tests/unit/plugins/modules/test_cpanm.yaml

Large diffs are not rendered by default.

74 changes: 37 additions & 37 deletions tests/unit/plugins/modules/test_django_check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,40 +7,40 @@
anchors:
environ: &env-def {environ_update: {LANGUAGE: C, LC_ALL: C}, check_rc: true}
test_cases:
- id: success
input:
settings: whatever.settings
output:
version: "5.1.2"
mocks:
run_command:
- command: [/testbin/python, -m, django, --version]
environ: *env-def
rc: 0
out: "5.1.2\n"
err: ""
- command: [/testbin/python, -m, django, check, --no-color, --settings=whatever.settings]
environ: *env-def
rc: 0
out: "whatever\n"
err: ""
- id: multiple_databases
input:
settings: whatever.settings
database:
- abc
- def
output:
version: "5.1.2"
mocks:
run_command:
- command: [/testbin/python, -m, django, --version]
environ: *env-def
rc: 0
out: "5.1.2\n"
err: ""
- command: [/testbin/python, -m, django, check, --no-color, --settings=whatever.settings, --database, abc, --database, def]
environ: *env-def
rc: 0
out: "whatever\n"
err: ""
- id: success
input:
settings: whatever.settings
output:
version: 5.1.2
mocks:
run_command:
- command: [/testbin/python, -m, django, --version]
environ: *env-def
rc: 0
out: "5.1.2\n"
err: ''
- command: [/testbin/python, -m, django, check, --no-color, --settings=whatever.settings]
environ: *env-def
rc: 0
out: "whatever\n"
err: ''
- id: multiple_databases
input:
settings: whatever.settings
database:
- abc
- def
output:
version: 5.1.2
mocks:
run_command:
- command: [/testbin/python, -m, django, --version]
environ: *env-def
rc: 0
out: "5.1.2\n"
err: ''
- command: [/testbin/python, -m, django, check, --no-color, --settings=whatever.settings, --database, abc, --database, def]
environ: *env-def
rc: 0
out: "whatever\n"
err: ''
88 changes: 44 additions & 44 deletions tests/unit/plugins/modules/test_django_command.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,47 +7,47 @@
anchors:
environ: &env-def {environ_update: {LANGUAGE: C, LC_ALL: C}, check_rc: true}
test_cases:
- id: command_success
input:
command: check
extra_args:
- babaloo
- yaba
- daba
- doo
settings: whatever.settings
mocks:
run_command:
- command: [/testbin/python, -m, django, --version]
environ: *env-def
rc: 0
out: "5.1.2\n"
err: ""
- command: [/testbin/python, -m, django, check, --no-color, --settings=whatever.settings, babaloo, yaba, daba, doo]
environ: *env-def
rc: 0
out: "whatever\n"
err: ""
- id: command_fail
input:
command: check
extra_args:
- babaloo
- yaba
- daba
- doo
settings: whatever.settings
output:
failed: true
mocks:
run_command:
- command: [/testbin/python, -m, django, --version]
environ: *env-def
rc: 0
out: "5.1.2\n"
err: ""
- command: [/testbin/python, -m, django, check, --no-color, --settings=whatever.settings, babaloo, yaba, daba, doo]
environ: *env-def
rc: 1
out: "whatever\n"
err: ""
- id: command_success
input:
command: check
extra_args:
- babaloo
- yaba
- daba
- doo
settings: whatever.settings
mocks:
run_command:
- command: [/testbin/python, -m, django, --version]
environ: *env-def
rc: 0
out: "5.1.2\n"
err: ''
- command: [/testbin/python, -m, django, check, --no-color, --settings=whatever.settings, babaloo, yaba, daba, doo]
environ: *env-def
rc: 0
out: "whatever\n"
err: ''
- id: command_fail
input:
command: check
extra_args:
- babaloo
- yaba
- daba
- doo
settings: whatever.settings
output:
failed: true
mocks:
run_command:
- command: [/testbin/python, -m, django, --version]
environ: *env-def
rc: 0
out: "5.1.2\n"
err: ''
- command: [/testbin/python, -m, django, check, --no-color, --settings=whatever.settings, babaloo, yaba, daba, doo]
environ: *env-def
rc: 1
out: "whatever\n"
err: ''
30 changes: 15 additions & 15 deletions tests/unit/plugins/modules/test_django_createcachetable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@
anchors:
environ: &env-def {environ_update: {LANGUAGE: C, LC_ALL: C}, check_rc: true}
test_cases:
- id: command_success
input:
settings: whatever.settings
mocks:
run_command:
- command: [/testbin/python, -m, django, --version]
environ: *env-def
rc: 0
out: "5.1.2\n"
err: ""
- command: [/testbin/python, -m, django, createcachetable, --no-color, --settings=whatever.settings, --noinput, --database=default]
environ: *env-def
rc: 0
out: "whatever\n"
err: ""
- id: command_success
input:
settings: whatever.settings
mocks:
run_command:
- command: [/testbin/python, -m, django, --version]
environ: *env-def
rc: 0
out: "5.1.2\n"
err: ''
- command: [/testbin/python, -m, django, createcachetable, --no-color, --settings=whatever.settings, --noinput, --database=default]
environ: *env-def
rc: 0
out: "whatever\n"
err: ''
72 changes: 36 additions & 36 deletions tests/unit/plugins/modules/test_facter_facts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,39 @@
anchors:
environ: &env-def {check_rc: true}
test_cases:
- id: simple run
output:
ansible_facts:
facter:
a: 1
b: 2
c: 3
mocks:
run_command:
- command: [/testbin/facter, --json]
environ: *env-def
rc: 0
out: >
{ "a": 1, "b": 2, "c": 3 }
err: ""
- id: with args
input:
arguments:
- -p
- system_uptime
- timezone
- is_virtual
output:
ansible_facts:
facter:
a: 1
b: 2
c: 3
mocks:
run_command:
- command: [/testbin/facter, --json, -p, system_uptime, timezone, is_virtual]
environ: *env-def
rc: 0
out: >
{ "a": 1, "b": 2, "c": 3 }
err: ""
- id: simple run
output:
ansible_facts:
facter:
a: 1
b: 2
c: 3
mocks:
run_command:
- command: [/testbin/facter, --json]
environ: *env-def
rc: 0
out: >
{ "a": 1, "b": 2, "c": 3 }
err: ''
- id: with args
input:
arguments:
- -p
- system_uptime
- timezone
- is_virtual
output:
ansible_facts:
facter:
a: 1
b: 2
c: 3
mocks:
run_command:
- command: [/testbin/facter, --json, -p, system_uptime, timezone, is_virtual]
environ: *env-def
rc: 0
out: >
{ "a": 1, "b": 2, "c": 3 }
err: ''
Loading

0 comments on commit c1550c7

Please sign in to comment.