def test_strip(prefix, app_prefix, args_line, args_line_index): app_prefix = prefix + app_prefix if args_line: app_prefix = app_prefix + " " line = "{}{}".format(app_prefix, args_line) result_line = BashCompletion.strip_python_or_app_name(line) assert result_line == args_line
def test_strip(app_prefix, args_line, args_line_index): if args_line: app_prefix = app_prefix + " " line = "{}{}".format(app_prefix, args_line) index = len( app_prefix) + args_line_index if args_line_index is not None else None result_line, result_index = BashCompletion.strip_python_or_app_name( line, index) assert result_line == args_line assert result_index == args_line_index