From 38f4b300ae9ffb7f18f43c49d0b1c8cbd9fa9461 Mon Sep 17 00:00:00 2001 From: antonylebechec Date: Wed, 8 May 2024 18:17:20 +0200 Subject: [PATCH] add test for common --- tests/test_commons.py | 44 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/tests/test_commons.py b/tests/test_commons.py index 9bc8f61..1a04aaf 100644 --- a/tests/test_commons.py +++ b/tests/test_commons.py @@ -28,6 +28,50 @@ from test_needed import * +def test_help(): + + # Init + help_json_file = os.path.join(folder_main, "docs", "json", "help.param.json") + + # Help JSON to MD + help_content_md = help_generation_from_json( + help_json_file=help_json_file, + output_type="markdown", + title="test", + code_type="json", + ) + assert help_content_md != "" + + # Help JSON to HTML + help_content_html = help_generation_from_json( + help_json_file=help_json_file, + output_type="html", + title="test", + code_type="json", + ) + assert help_content_html != "" + + # Help + from howard.tools.tools import arguments, commands_arguments, shared_arguments + + setup_cfg = f"{main_folder}/../../setup.cfg" + arguments_dict = { + "arguments": arguments, + "commands_arguments": commands_arguments, + "shared_arguments": shared_arguments, + } + help_content = help_generation( + arguments_dict=arguments_dict, setup=setup_cfg, output_type="markdown" + ) + assert help_content != "" + + # Gooey argument + argument_gooey = get_argument_gooey( + arguments=arguments, arg=list(arguments.keys())[0] + ) + assert argument_gooey != "" + + def test_identical_with_identical_files(): with tempfile.NamedTemporaryFile( mode="w", delete=False