fork/mons
git clone https://git.julia.blue/fork/mons
384a235
fixes
1import warnings 2 3import click 4 5 6def test_command_help (command :"click.Command" ): 7if command .hidden : 8return 9 10assert command .help ,f"Command ' { command . name } ' is missing help text" 11assert ( 12command .get_short_help_str () 13 ),f"Command ' { command . name } ' is missing short help text" 14 15 16def test_option_help (command :"click.Command" ): 17if command .hidden : 18return 19 20for param in command .params : 21if isinstance (param ,click .Option )and not param .hidden : 22assert ( 23param .help 24 ),f"Option ' { param . name } ' for command ' { command . name } ' is missing help text" 25assert param .help .strip ().endswith ( 26"." 27 ),f"The help text for option ' { param . name } ' for command ' { command . name } ' does not end with a '.'" 28 29 30def test_no_args_is_help (command :"click.Command" ): 31if command .hidden : 32return 33# Note: commands with only a clickExt.OptionalArg required do *not* fail this test. 34# When an optional arg is applied 'no_args_is_help' is disabled. 35 36if command .no_args_is_help : 37assert any ( 38param .required for param in command .params 39 ),"Command can be invoked with no arguments, but has 'no_args_is_help' enabled." 40elif any (param .required for param in command .params ): 41warnings .warn ("Command does not have 'no_args_is_help' enabled, but could." )