-
Notifications
You must be signed in to change notification settings - Fork 237
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test for print_result function (#126)
Change severity to severity_level on tasks, add tests to print_output
- Loading branch information
Showing
37 changed files
with
376 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
decorator | ||
pytest | ||
pytest-cov | ||
pylama | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
Empty file.
17 changes: 17 additions & 0 deletions
17
tests/plugins/functions/text/output_data/basic_inventory.stdout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[1m[36mecho_task*********************************************************************** | ||
[1m[34m* dev1.group_1 ** changed : False ********************************************** | ||
[1m[32mvvvv echo_task ** changed : False vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv INFO | ||
Hello from Brigade | ||
[1m[32m^^^^ END echo_task ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
[1m[34m* dev2.group_1 ** changed : False ********************************************** | ||
[1m[32mvvvv echo_task ** changed : False vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv INFO | ||
Hello from Brigade | ||
[1m[32m^^^^ END echo_task ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
[1m[34m* dev3.group_2 ** changed : False ********************************************** | ||
[1m[32mvvvv echo_task ** changed : False vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv INFO | ||
Hello from Brigade | ||
[1m[32m^^^^ END echo_task ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
[1m[34m* dev4.group_2 ** changed : False ********************************************** | ||
[1m[32mvvvv echo_task ** changed : False vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv INFO | ||
Hello from Brigade | ||
[1m[32m^^^^ END echo_task ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
Empty file.
6 changes: 6 additions & 0 deletions
6
tests/plugins/functions/text/output_data/basic_inventory_one_host.stdout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[1m[32mvvvv data_with_greeting ** changed : False vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv INFO | ||
[1m[32m---- echo_task ** changed : False ---------------------------------------------- INFO | ||
Hello from Brigade | ||
[1m[32m---- load_data ** changed : False ---------------------------------------------- INFO | ||
{'os': 'Linux', 'services': ['http', 'smtp', 'dns']} | ||
[1m[32m^^^^ END data_with_greeting ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
Empty file.
6 changes: 6 additions & 0 deletions
6
tests/plugins/functions/text/output_data/basic_inventory_one_host_python27.stdout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[1m[32mvvvv data_with_greeting ** changed : False vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv INFO | ||
[1m[32m---- echo_task ** changed : False ---------------------------------------------- INFO | ||
Hello from Brigade | ||
[1m[32m---- load_data ** changed : False ---------------------------------------------- INFO | ||
{ 'os': 'Linux', 'services': ['http', 'smtp', 'dns']} | ||
[1m[32m^^^^ END data_with_greeting ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
Empty file.
2 changes: 2 additions & 0 deletions
2
tests/plugins/functions/text/output_data/basic_inventory_one_task.stdout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[1m[32m---- echo_task ** changed : False ---------------------------------------------- INFO | ||
Hello from Brigade |
Empty file.
2 changes: 2 additions & 0 deletions
2
tests/plugins/functions/text/output_data/basic_inventory_one_task_python27.stdout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[1m[32m---- echo_task ** changed : False ---------------------------------------------- INFO | ||
Hello from Brigade |
Empty file.
17 changes: 17 additions & 0 deletions
17
tests/plugins/functions/text/output_data/basic_inventory_python27.stdout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[1m[36mecho_task*********************************************************************** | ||
[1m[34m* dev1.group_1 ** changed : False ********************************************** | ||
[1m[32mvvvv echo_task ** changed : False vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv INFO | ||
Hello from Brigade | ||
[1m[32m^^^^ END echo_task ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
[1m[34m* dev2.group_1 ** changed : False ********************************************** | ||
[1m[32mvvvv echo_task ** changed : False vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv INFO | ||
Hello from Brigade | ||
[1m[32m^^^^ END echo_task ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
[1m[34m* dev3.group_2 ** changed : False ********************************************** | ||
[1m[32mvvvv echo_task ** changed : False vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv INFO | ||
Hello from Brigade | ||
[1m[32m^^^^ END echo_task ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
[1m[34m* dev4.group_2 ** changed : False ********************************************** | ||
[1m[32mvvvv echo_task ** changed : False vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv INFO | ||
Hello from Brigade | ||
[1m[32m^^^^ END echo_task ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[1m[36mecho_task*********************************************************************** | ||
[1m[34m* dev1.group_1 ** changed : False ********************************************** | ||
[1m[32mvvvv echo_task ** changed : False vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv INFO | ||
Hello from Brigade | ||
[1m[32m^^^^ END echo_task ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
Empty file.
5 changes: 5 additions & 0 deletions
5
tests/plugins/functions/text/output_data/basic_single_python27.stdout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[1m[36mecho_task*********************************************************************** | ||
[1m[34m* dev1.group_1 ** changed : False ********************************************** | ||
[1m[32mvvvv echo_task ** changed : False vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv INFO | ||
Hello from Brigade | ||
[1m[32m^^^^ END echo_task ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
Empty file.
15 changes: 15 additions & 0 deletions
15
tests/plugins/functions/text/output_data/changed_host.stdout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[1m[36mread_data*********************************************************************** | ||
[1m[34m* dev1.group_1 ** changed : True *********************************************** | ||
[1m[32mvvvv read_data ** changed : False vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv WARNING | ||
[1m[32m---- echo_task ** changed : False ---------------------------------------------- CRITICAL | ||
Hello from CRITICAL | ||
[1m[33m---- parse_data ** changed : True ---------------------------------------------- WARNING | ||
[1, 2, 3] | ||
[1m[32m^^^^ END read_data ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
[1m[34m* dev2.group_1 ** changed : False ********************************************** | ||
[1m[32mvvvv read_data ** changed : False vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv WARNING | ||
[1m[32m---- echo_task ** changed : False ---------------------------------------------- CRITICAL | ||
Hello from CRITICAL | ||
[1m[32m---- parse_data ** changed : False --------------------------------------------- WARNING | ||
[4, 5, 6] | ||
[1m[32m^^^^ END read_data ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
Empty file.
15 changes: 15 additions & 0 deletions
15
tests/plugins/functions/text/output_data/changed_host_python27.stdout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[1m[36mread_data*********************************************************************** | ||
[1m[34m* dev1.group_1 ** changed : True *********************************************** | ||
[1m[32mvvvv read_data ** changed : False vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv WARNING | ||
[1m[32m---- echo_task ** changed : False ---------------------------------------------- CRITICAL | ||
Hello from CRITICAL | ||
[1m[33m---- parse_data ** changed : True ---------------------------------------------- WARNING | ||
[1, 2, 3] | ||
[1m[32m^^^^ END read_data ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
[1m[34m* dev2.group_1 ** changed : False ********************************************** | ||
[1m[32mvvvv read_data ** changed : False vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv WARNING | ||
[1m[32m---- echo_task ** changed : False ---------------------------------------------- CRITICAL | ||
Hello from CRITICAL | ||
[1m[32m---- parse_data ** changed : False --------------------------------------------- WARNING | ||
[4, 5, 6] | ||
[1m[32m^^^^ END read_data ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
Empty file.
19 changes: 19 additions & 0 deletions
19
tests/plugins/functions/text/output_data/failed_with_severity.stdout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
[1m[36mread_data*********************************************************************** | ||
[1m[34m* dev1.group_1 ** changed : True *********************************************** | ||
[1m[32m---- echo_task ** changed : False ---------------------------------------------- CRITICAL | ||
Hello from CRITICAL | ||
[1m[32m^^^^ END read_data ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
[1m[34m* dev2.group_1 ** changed : False ********************************************** | ||
[1m[32m---- echo_task ** changed : False ---------------------------------------------- CRITICAL | ||
Hello from CRITICAL | ||
[1m[32m^^^^ END read_data ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
[1m[34m* dev3.group_2 ** changed : False ********************************************** | ||
[1m[32m---- echo_task ** changed : False ---------------------------------------------- CRITICAL | ||
Hello from CRITICAL | ||
[1m[32m^^^^ END read_data ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
[1m[34m* dev4.group_2 ** changed : False ********************************************** | ||
[1m[31mvvvv read_data ** changed : False vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv ERROR | ||
Exception('Unknown Error -> Contact your system administrator',) | ||
[1m[32m---- echo_task ** changed : False ---------------------------------------------- CRITICAL | ||
Hello from CRITICAL | ||
[1m[31m^^^^ END read_data ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
Empty file.
19 changes: 19 additions & 0 deletions
19
tests/plugins/functions/text/output_data/failed_with_severity_python27.stdout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
[1m[36mread_data*********************************************************************** | ||
[1m[34m* dev1.group_1 ** changed : True *********************************************** | ||
[1m[32m---- echo_task ** changed : False ---------------------------------------------- CRITICAL | ||
Hello from CRITICAL | ||
[1m[32m^^^^ END read_data ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
[1m[34m* dev2.group_1 ** changed : False ********************************************** | ||
[1m[32m---- echo_task ** changed : False ---------------------------------------------- CRITICAL | ||
Hello from CRITICAL | ||
[1m[32m^^^^ END read_data ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
[1m[34m* dev3.group_2 ** changed : False ********************************************** | ||
[1m[32m---- echo_task ** changed : False ---------------------------------------------- CRITICAL | ||
Hello from CRITICAL | ||
[1m[32m^^^^ END read_data ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
[1m[34m* dev4.group_2 ** changed : False ********************************************** | ||
[1m[31mvvvv read_data ** changed : False vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv ERROR | ||
Exception('Unknown Error -> Contact your system administrator',) | ||
[1m[32m---- echo_task ** changed : False ---------------------------------------------- CRITICAL | ||
Hello from CRITICAL | ||
[1m[31m^^^^ END read_data ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
Empty file.
Oops, something went wrong.