-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
split up cli tests for easier zero'ing in issues.
- Loading branch information
Showing
11 changed files
with
271 additions
and
130 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# tests are structured in the manner of: | ||
# https://click.palletsprojects.com/en/8.1.x/testing/ | ||
# general intent is to test the cli of each (sub)tool | ||
# command, help, command does not exist | ||
|
||
from click.testing import CliRunner | ||
runner = CliRunner() | ||
|
||
from fre import fre | ||
|
||
# tests for base 'fre app' calls | ||
|
||
def test_cli_fre_app(): | ||
result = runner.invoke(fre.fre, args=["app"]) | ||
assert result.exit_code == 0 | ||
|
||
def test_cli_fre_app_help(): | ||
result = runner.invoke(fre.fre, args=["app", "--help"]) | ||
assert result.exit_code == 0 | ||
|
||
def test_cli_fre_app_opt_dne(): | ||
result = runner.invoke(fre.fre, args=["app", "optionDNE"]) | ||
assert result.exit_code == 2 |
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,38 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# tests are structured in the manner of: | ||
# https://click.palletsprojects.com/en/8.1.x/testing/ | ||
# general intent is to test the cli of each (sub)tool | ||
# command, help, command does not exist | ||
|
||
from click.testing import CliRunner | ||
runner = CliRunner() | ||
|
||
from fre import fre | ||
|
||
# tests for base 'fre catalog' calls | ||
|
||
def test_cli_fre_catalog(): | ||
result = runner.invoke(fre.fre, args=["catalog"]) | ||
assert result.exit_code == 0 | ||
|
||
def test_cli_fre_catalog_help(): | ||
result = runner.invoke(fre.fre, args=["catalog", "--help"]) | ||
assert result.exit_code == 0 | ||
|
||
def test_cli_fre_catalog_opt_dne(): | ||
result = runner.invoke(fre.fre, args=["catalog", "optionDNE"]) | ||
assert result.exit_code == 2 | ||
|
||
def test_cli_fre_catalog_builder(): | ||
result = runner.invoke(fre.fre, args=["catalog", "builder", "--help"]) | ||
assert result.exit_code == 0 | ||
|
||
def test_cli_fre_catalog_builder(): | ||
result = runner.invoke(fre.fre, args=["catalog", "builder"]) | ||
assert all( [ | ||
result.exit_code == 1, | ||
'No paths given, using yaml configuration' | ||
in result.stdout.split('\n') | ||
] | ||
) |
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,25 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# tests are structured in the manner of: | ||
# https://click.palletsprojects.com/en/8.1.x/testing/ | ||
# general intent is to test the cli of each (sub)tool | ||
# command, help, command does not exist | ||
|
||
from click.testing import CliRunner | ||
runner = CliRunner() | ||
|
||
from fre import fre | ||
|
||
# tests for base 'fre check' calls | ||
|
||
def test_cli_fre_check(): | ||
result = runner.invoke(fre.fre, args=["check"]) | ||
assert result.exit_code == 0 | ||
|
||
def test_cli_fre_check_help(): | ||
result = runner.invoke(fre.fre, args=["check", "--help"]) | ||
assert result.exit_code == 0 | ||
|
||
def test_cli_fre_check_opt_dne(): | ||
result = runner.invoke(fre.fre, args=["check", "optionDNE"]) | ||
assert result.exit_code == 2 |
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,151 +1,29 @@ | ||
#!/usr/bin/env python3 | ||
|
||
from fre import fre | ||
# tests are structured in the manner of: | ||
# https://click.palletsprojects.com/en/8.1.x/testing/ | ||
# general intent is to test the cli of each (sub)tool | ||
# command, help, command does not exist | ||
|
||
from click.testing import CliRunner | ||
runner = CliRunner() | ||
|
||
#tests are structured in the manner of: | ||
#https://click.palletsprojects.com/en/8.1.x/testing/ | ||
#general intent for these tests is that each fre tool has 3 commandline tests: | ||
#command, help, command does not exist | ||
from fre import fre | ||
|
||
#Test list: | ||
#fre | ||
#-- fre app | ||
#-- fre catalog | ||
#-- fre check | ||
#-- fre cmor | ||
#-- fre list | ||
#-- fre make | ||
#-- fre pp | ||
#-- fre run | ||
# tests for base 'fre' calls | ||
|
||
def test_cli_fre(): | ||
result = runner.invoke(fre.fre) | ||
#print(f'exit code of runner result is {result.exit_code}') | ||
#print(f'output of runner result is {result.output}') | ||
assert result.exit_code == 0 | ||
|
||
def test_cli_fre_help(): | ||
result = runner.invoke(fre.fre,args='--help') | ||
#print(f'exit code of runner result is {result.exit_code}') | ||
#print(f'output of runner result is {result.output}') | ||
result = runner.invoke(fre.fre, args='--help') | ||
assert result.exit_code == 0 | ||
|
||
def test_cli_fre_option_dne(): | ||
result = runner.invoke(fre.fre,args='optionDNE') | ||
#print(f'exit code of runner result is {result.exit_code}') | ||
#print(f'output of runner result is {result.output}') | ||
assert result.exit_code == 2 | ||
|
||
#-- fre app | ||
|
||
def test_cli_fre_app(): | ||
result = runner.invoke(fre.fre, args=["app"]) | ||
assert result.exit_code == 0 | ||
|
||
def test_cli_fre_app_help(): | ||
result = runner.invoke(fre.fre, args=['--help', "app"]) | ||
assert result.exit_code == 0 | ||
|
||
def test_cli_fre_app_opt_dne(): | ||
result = runner.invoke(fre.fre, args=['optionDNE', "app"]) | ||
assert result.exit_code == 2 | ||
|
||
#-- fre catalog | ||
def test_cli_fre_catalog(): | ||
result = runner.invoke(fre.fre, args=["catalog"]) | ||
assert result.exit_code == 0 | ||
|
||
def test_cli_fre_catalog_builder_help(): | ||
result = runner.invoke(fre.fre, args=["catalog", "builder", "--help"]) | ||
assert result.exit_code == 0 | ||
|
||
def test_cli_fre_catalog_help(): | ||
result = runner.invoke(fre.fre, args=['--help', "catalog"]) | ||
assert result.exit_code == 0 | ||
|
||
def test_cli_fre_catalog_opt_dne(): | ||
result = runner.invoke(fre.fre, args=['optionDNE', "catalog"]) | ||
result = runner.invoke(fre.fre, args='optionDNE') | ||
assert result.exit_code == 2 | ||
|
||
#-- fre check | ||
|
||
def test_cli_fre_check(): | ||
result = runner.invoke(fre.fre, args=["check"]) | ||
assert result.exit_code == 0 | ||
|
||
def test_cli_fre_check_help(): | ||
result = runner.invoke(fre.fre, args=['--help', "check"]) | ||
assert result.exit_code == 0 | ||
|
||
def test_cli_fre_check_opt_dne(): | ||
result = runner.invoke(fre.fre, args=['optionDNE', "check"]) | ||
assert result.exit_code == 2 | ||
|
||
#-- fre cmor | ||
|
||
def test_cli_fre_cmor(): | ||
result = runner.invoke(fre.fre, args=["cmor"]) | ||
assert result.exit_code == 0 | ||
|
||
def test_cli_fre_cmor_help(): | ||
result = runner.invoke(fre.fre, args=['--help', "cmor"]) | ||
assert result.exit_code == 0 | ||
|
||
def test_cli_fre_cmor_opt_dne(): | ||
result = runner.invoke(fre.fre, args=['optionDNE', "cmor"]) | ||
assert result.exit_code == 2 | ||
|
||
#-- fre list | ||
def test_cli_fre_list(): | ||
result = runner.invoke(fre.fre, args=["list"]) | ||
assert result.exit_code == 0 | ||
|
||
def test_cli_fre_list_help(): | ||
result = runner.invoke(fre.fre, args=['--help', "list"]) | ||
assert result.exit_code == 0 | ||
|
||
def test_cli_fre_list_opt_dne(): | ||
result = runner.invoke(fre.fre, args=['optionDNE', "list"]) | ||
assert result.exit_code == 2 | ||
|
||
#-- fre make | ||
def test_cli_fre_make(): | ||
result = runner.invoke(fre.fre, args=["make"]) | ||
assert result.exit_code == 0 | ||
|
||
def test_cli_fre_make_help(): | ||
result = runner.invoke(fre.fre, args=['--help', "make"]) | ||
assert result.exit_code == 0 | ||
|
||
def test_cli_fre_make_opt_dne(): | ||
result = runner.invoke(fre.fre, args=['optionDNE', "make"]) | ||
assert result.exit_code == 2 | ||
|
||
#-- fre pp | ||
def test_cli_fre_pp(): | ||
result = runner.invoke(fre.fre, args=["pp"]) | ||
assert result.exit_code == 0 | ||
|
||
def test_cli_fre_pp_help(): | ||
result = runner.invoke(fre.fre, args=['--help', "pp"]) | ||
assert result.exit_code == 0 | ||
|
||
def test_cli_fre_pp_opt_dne(): | ||
result = runner.invoke(fre.fre, args=['optionDNE', "pp"]) | ||
assert result.exit_code == 2 | ||
|
||
#-- fre run | ||
def test_cli_fre_run(): | ||
result = runner.invoke(fre.fre, args=["run"]) | ||
assert result.exit_code == 0 | ||
|
||
def test_cli_fre_run_help(): | ||
result = runner.invoke(fre.fre, args=['--help', "run"]) | ||
assert result.exit_code == 0 | ||
|
||
def test_cli_fre_run_opt_dne(): | ||
result = runner.invoke(fre.fre, args=['optionDNE', "run"]) | ||
assert result.exit_code == 2 |
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,25 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# tests are structured in the manner of: | ||
# https://click.palletsprojects.com/en/8.1.x/testing/ | ||
# general intent is to test the cli of each (sub)tool | ||
# command, help, command does not exist | ||
|
||
from click.testing import CliRunner | ||
runner = CliRunner() | ||
|
||
from fre import fre | ||
|
||
# tests for base 'fre cmor' calls | ||
|
||
def test_cli_fre_cmor(): | ||
result = runner.invoke(fre.fre, args=["cmor"]) | ||
assert result.exit_code == 0 | ||
|
||
def test_cli_fre_cmor_help(): | ||
result = runner.invoke(fre.fre, args=["cmor", "--help"]) | ||
assert result.exit_code == 0 | ||
|
||
def test_cli_fre_cmor_opt_dne(): | ||
result = runner.invoke(fre.fre, args=["cmor", "optionDNE"]) | ||
assert result.exit_code == 2 |
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,25 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# tests are structured in the manner of: | ||
# https://click.palletsprojects.com/en/8.1.x/testing/ | ||
# general intent is to test the cli of each (sub)tool | ||
# command, help, command does not exist | ||
|
||
from click.testing import CliRunner | ||
runner = CliRunner() | ||
|
||
from fre import fre | ||
|
||
# tests for base 'fre list' calls | ||
|
||
def test_cli_fre_list(): | ||
result = runner.invoke(fre.fre, args=["list"]) | ||
assert result.exit_code == 0 | ||
|
||
def test_cli_fre_list_help(): | ||
result = runner.invoke(fre.fre, args=["list", "--help"]) | ||
assert result.exit_code == 0 | ||
|
||
def test_cli_fre_list_opt_dne(): | ||
result = runner.invoke(fre.fre, args=["list", "optionDNE"]) | ||
assert result.exit_code == 2 |
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,25 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# tests are structured in the manner of: | ||
# https://click.palletsprojects.com/en/8.1.x/testing/ | ||
# general intent is to test the cli of each (sub)tool | ||
# command, help, command does not exist | ||
|
||
from click.testing import CliRunner | ||
runner = CliRunner() | ||
|
||
from fre import fre | ||
|
||
# tests for base 'fre make' calls | ||
|
||
def test_cli_fre_make(): | ||
result = runner.invoke(fre.fre, args=["make"]) | ||
assert result.exit_code == 0 | ||
|
||
def test_cli_fre_make_help(): | ||
result = runner.invoke(fre.fre, args=["make", "--help"]) | ||
assert result.exit_code == 0 | ||
|
||
def test_cli_fre_make_opt_dne(): | ||
result = runner.invoke(fre.fre, args=["make", "optionDNE"]) | ||
assert result.exit_code == 2 |
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,25 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# tests are structured in the manner of: | ||
# https://click.palletsprojects.com/en/8.1.x/testing/ | ||
# general intent is to test the cli of each (sub)tool | ||
# command, help, command does not exist | ||
|
||
from click.testing import CliRunner | ||
runner = CliRunner() | ||
|
||
from fre import fre | ||
|
||
# tests for base 'fre pp' calls | ||
|
||
def test_cli_fre_pp(): | ||
result = runner.invoke(fre.fre, args=["pp"]) | ||
assert result.exit_code == 0 | ||
|
||
def test_cli_fre_pp_help(): | ||
result = runner.invoke(fre.fre, args=["pp", "--help"]) | ||
assert result.exit_code == 0 | ||
|
||
def test_cli_fre_pp_opt_dne(): | ||
result = runner.invoke(fre.fre, args=["pp", "optionDNE"]) | ||
assert result.exit_code == 2 |
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,25 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# tests are structured in the manner of: | ||
# https://click.palletsprojects.com/en/8.1.x/testing/ | ||
# general intent is to test the cli of each (sub)tool | ||
# command, help, command does not exist | ||
|
||
from click.testing import CliRunner | ||
runner = CliRunner() | ||
|
||
from fre import fre | ||
|
||
# tests for base 'fre run' calls | ||
|
||
def test_cli_fre_run(): | ||
result = runner.invoke(fre.fre, args=["run"]) | ||
assert result.exit_code == 0 | ||
|
||
def test_cli_fre_run_help(): | ||
result = runner.invoke(fre.fre, args=["run", "--help"]) | ||
assert result.exit_code == 0 | ||
|
||
def test_cli_fre_run_opt_dne(): | ||
result = runner.invoke(fre.fre, args=["run", "optionDNE"]) | ||
assert result.exit_code == 2 |
Oops, something went wrong.