Skip to content

Commit

Permalink
refac: Few error messages has been changed. Also, type validation add…
Browse files Browse the repository at this point in the history
…ed. #2075
  • Loading branch information
Luis Gonzalez committed Oct 26, 2021
1 parent 2bb06f1 commit 81b6ccd
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions deps/wazuh_testing/wazuh_testing/scripts/qa_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,13 @@ def check_incompatible_parameters(parameters):
qadocs_logger.error)

if parameters.output_path and default_run:
raise QAValueError('The -o parameter only works with -t, --tests options in isolation. The default output '
raise QAValueError('The -o parameter only works with -t, --tests option. The default output '
'path is generated within the qa-docs tool to index it and visualize it.',
qadocs_logger.error)

if (parameters.test_types or parameters.test_modules) and test_run:
raise QAValueError('The --types, --modules parameters parse the data so you can index it and visualize it. '
'-t, --tests get specific tests information.',
'-t, --tests, -e and --exist are not compatible with them.',
qadocs_logger.error)

if parameters.no_logging and parameters.debug_level:
Expand Down Expand Up @@ -187,6 +187,12 @@ def validate_parameters(parameters, parser):
'one type if you want to parse some modules within a test type.',
qadocs_logger.error)

if parameters.test_types:
for type in parameters.test_types:
if type not in os.listdir(parameters.tests_path):
raise QAValueError(f"The given types, {parameters.test_types}, not found in {parameters.tests_path}",
qadocs_logger.error)

qadocs_logger.debug('Input parameters validation completed')


Expand Down

0 comments on commit 81b6ccd

Please sign in to comment.