Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for cli #405

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class Algorithm(StrEnum):
VERBOSE = 'verbose'
ERROR = 'error'
ERROR_MEASURE = 'error_measure'
TABLE = 'table'
TABLES = 'tables'
TABLES_LIST = 'tables_list'
TABLES_DIRECTORY = 'tables_directory'
Expand Down Expand Up @@ -144,9 +145,6 @@ class Algorithm(StrEnum):
Algorithms for some tasks (currently, only IND) accept multiple
input files; see --task=TASK for more information

--is_null_equal_null=BOOLEAN
specify whether two NULLs should be considered equal

--filename=FILENAME
specify the file to write the results to. If none is selected, output is
written to the console
Expand Down Expand Up @@ -469,7 +467,9 @@ class Algorithm(StrEnum):
Algorithm.naive_ucc_verifier),
Task.aucc_verification: TaskInfo([Algorithm.naive_aucc_verifier],
Algorithm.naive_aucc_verifier),
Task.gfd_verification: TaskInfo([Algorithm.naive_gfd_verifier, Algorithm.gfd_verifier, Algorithm.egfd_verifier],
Task.gfd_verification: TaskInfo([Algorithm.naive_gfd_verifier,
Algorithm.gfd_verifier,
Algorithm.egfd_verifier],
Algorithm.naive_gfd_verifier),
}

Expand Down Expand Up @@ -697,8 +697,10 @@ def print_help_page(algo_name: str | None, task: str | None) -> None:
def print_algo_help_page(algo_name: str) -> None:
algo = ALGOS[Algorithm(algo_name)]()
help_info = ''
for opt in algo.get_possible_options():
if opt not in ('table', TABLES, 'is_null_equal_null'):
algo_options = list(algo.get_possible_options())
algo_options.sort()
for opt in algo_options:
if opt not in (TABLE, TABLES):
help_info += get_option_help_info(opt, algo)
click.echo(f'{ALGO_HELP_PAGES[Algorithm(algo_name)]}{help_info}')

Expand Down
3 changes: 3 additions & 0 deletions cli/cli_tests/dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
click==8.1.6
desbordante==2.0.0
snapshottest==0.6.0
Loading
Loading