<s> import click <EOL> def test_basic_functionality ( runner ) : <EOL> @ click . command ( ) <EOL> def cli ( ) : <EOL> """<STR_LIT>""" <EOL> result = runner . invoke ( cli , [ '<STR_LIT>' ] , terminal_width = <NUM_LIT> ) <EOL> assert not result . exception <EOL> assert result . output . splitlines ( ) == [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ] <EOL> def test_wrapping_long_options_strings ( runner ) : <EOL> @ click . group ( ) <EOL> def cli ( ) : <EOL> """<STR_LIT>""" <EOL> @ cli . group ( ) <EOL> def a_very_long ( ) : <EOL> """<STR_LIT>""" <EOL> @ a_very_long . command ( ) <EOL> @ click . argument ( '<STR_LIT>' ) <EOL> @ click . argument ( '<STR_LIT>' ) <EOL> @ click . argument ( '<STR_LIT>' ) <EOL> @ click . argument ( '<STR_LIT>' ) <EOL> @ click . argument ( '<STR_LIT>' ) <EOL> @ click . argument ( '<STR_LIT>' ) <EOL> def command ( ) : <EOL> """<STR_LIT>""" <EOL> result = runner . invoke ( cli , [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> terminal_width = <NUM_LIT> ) <EOL> assert not result . exception <EOL> assert result . output . splitlines ( ) == [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ] <EOL> def test_wrapping_long_command_name ( runner ) : <EOL> @ click . group ( ) <EOL> def cli ( ) : <EOL> """<STR_LIT>""" <EOL> @ cli . group ( ) <EOL> def a_very_very_very_long ( ) : <EOL> """<STR_LIT>""" <EOL> @ a_very_very_very_long . command ( ) <EOL> @ click . argument ( '<STR_LIT>' ) <EOL> @ click . argument ( '<STR_LIT>' ) <EOL> @ click . argument ( '<STR_LIT>' ) <EOL> @ click . argument ( '<STR_LIT>' ) <EOL> @ click . argument ( '<STR_LIT>' ) <EOL> @ click . argument ( '<STR_LIT>' ) <EOL> def command ( ) : <EOL> """<STR_LIT>""" <EOL> result = runner . invoke ( cli , [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> terminal_width = <NUM_LIT> ) <EOL> assert not result . exception <EOL> assert result . output . splitlines ( ) == [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ] <EOL> def test_formatting_empty_help_lines ( runner ) : <EOL> @ click . command ( ) <EOL> def cli ( ) : <EOL> """<STR_LIT>""" <EOL> result = runner . invoke ( cli , [ '<STR_LIT>' ] ) <EOL> assert not result . exception <EOL> assert result . output . splitlines ( ) == [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ] <EOL> def test_formatting_usage_error ( runner ) : <EOL> @ click . command ( ) <EOL> @ click . argument ( '<STR_LIT>' ) <EOL> def cmd ( arg ) : <EOL> click . echo ( '<STR_LIT>' + arg ) <EOL> result = runner . invoke ( cmd , [ ] ) <EOL> assert result . exit_code == <NUM_LIT:2> <EOL> assert result . output . splitlines ( ) == [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' <EOL> ] <EOL> def test_formatting_usage_error_nested ( runner ) : <EOL> @ click . group ( ) <EOL> def cmd ( ) : <EOL> pass <EOL> @ cmd . command ( ) <EOL> @ click . argument ( '<STR_LIT:bar>' ) <EOL> def foo ( bar ) : <EOL> click . echo ( '<STR_LIT>' + bar ) <EOL> result = runner . invoke ( cmd , [ '<STR_LIT:foo>' ] ) <EOL> assert result . exit_code == <NUM_LIT:2> <EOL> assert result . output . splitlines ( ) == [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' <EOL> ] <EOL> def test_formatting_usage_error_no_help ( runner ) : <EOL> @ click . command ( add_help_option = False ) <EOL> @ click . argument ( '<STR_LIT>' ) <EOL> def cmd ( arg ) : <EOL> click . echo ( '<STR_LIT>' + arg ) <EOL> result = runner . invoke ( cmd , [ ] ) <EOL> assert result . exit_code == <NUM_LIT:2> <EOL> assert result . output . splitlines ( ) == [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' <EOL> ] <EOL> def test_formatting_usage_custom_help ( runner ) : <EOL> @ click . command ( context_settings = dict ( help_option_names = [ '<STR_LIT>' ] ) ) <EOL> @ click . argument ( '<STR_LIT>' ) <EOL> def cmd ( arg ) : <EOL> click . echo ( '<STR_LIT>' + arg ) <EOL> result = runner . invoke ( cmd , [ ] ) <EOL> assert result . exit_code == <NUM_LIT:2> <EOL> assert result . output . splitlines ( ) == [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' <EOL> ] </s>
