MCPcopy
hub / github.com/pallets/click / test_help_formatter_write_usage

Function test_help_formatter_write_usage

tests/test_formatting.py:562–574  ·  tests/test_formatting.py::test_help_formatter_write_usage

``HelpFormatter.write_usage`` renders a single usage line whose trailing separator tracks whether ``args`` is non-empty.

(
    formatter_kwargs, current_indent, prog, args, prefix, expected
)

Source from the content-addressed store, hash-verified

560 ],
561)
562def test_help_formatter_write_usage(
563 formatter_kwargs, current_indent, prog, args, prefix, expected
564):
565 class="st">"""``HelpFormatter.write_usage`` renders a single usage line whose
566 trailing separator tracks whether ``args`` is non-empty.
567 class="st">"""
568 f = click.HelpFormatter(**formatter_kwargs)
569 f.current_indent = current_indent
570 if prefix is None:
571 f.write_usage(prog, args)
572 else:
573 f.write_usage(prog, args, prefix=prefix)
574 assert f.getvalue() == expected
575
576
577def test_help_formatter_write_usage_without_args_styled_prefix():

Callers

nothing calls this directly

Calls 2

write_usageMethod · 0.95
getvalueMethod · 0.95

Tested by

no test coverage detected