def test_format_command_result__empty_output(caplog, log_level): caplog.set_level(log_level) actual = wheel.format_command_result( command_args=['arg1', 'arg2'], command_output='', ) assert actual.splitlines() == [ "Command arguments: arg1 arg2", 'Command output: None', ]
def test_format_command_result__INFO(caplog): caplog.set_level(logging.INFO) actual = wheel.format_command_result( # Include an argument with a space to test argument quoting. command_args=['arg1', 'second arg'], command_output='output line 1\noutput line 2\n', ) assert actual.splitlines() == [ "Command arguments: arg1 'second arg'", 'Command output: [use --verbose to show]', ]
def test_format_command_result__DEBUG(caplog, command_output): caplog.set_level(logging.DEBUG) actual = wheel.format_command_result( command_args=['arg1', 'arg2'], command_output=command_output, ) assert actual.splitlines() == [ "Command arguments: arg1 arg2", 'Command output:', 'output line 1', 'output line 2', '----------------------------------------', ]