tests.test_tree module¶
Tests for the command-tree rendering feature.
- tests.test_tree.OBSERVATORY_TREE = 'observatory Weather observatory control center.\n├── help [COMMAND_PATH]... Show help for a command.\n├── report CITY Print the forecast for a city.\n├── station (st) Manage remote weather stations.\n│ ├── calibrate Recalibrate the sensors.\n│ ├── help [COMMAND_PATH]... Show help for a command.\n│ └── reboot Power-cycle the station. (DEPRECATED)\n└── status Report the current conditions.'¶
Expected unstyled tree of the
observatoryfixture CLI.Descriptions are column-aligned on the longest rail-plus-label row, hidden commands are skipped, aliases are parenthesized, operand metavars follow the command name and deprecated commands carry their marker. The
helpentries are the implicit subcommand every click-extra group registers.
- tests.test_tree.test_render_tree_theme_styling()[source]¶
Nodes reuse the same theme slots and styling as help screens.
- tests.test_tree.test_render_tree_paints_each_choice_of_an_operand()[source]¶
An operand enumerating its values draws them the way a help screen does.
Painted one value at a time rather than as a single metavar span, so a reader picks the accepted words out of the punctuation around them.
- tests.test_tree.test_render_tree_paints_the_deprecation_label()[source]¶
The marker takes the slot the help screen paints it with.
A description reaches the tree already carrying Click’s label, and it is the only part of a node the name-and-metavar pass does not style.
- tests.test_tree.test_render_tree_wraps_descriptions()[source]¶
Long descriptions wrap in the aligned column, rail running through.
- tests.test_tree.test_tree_option_accessible_ascii_rail(runner)[source]¶
Accessibility mode degrades the box-drawing rail to pure ASCII.
- tests.test_tree.test_wrap_tree_drills_into_subcommand(runner, kitchen_script)[source]¶
Extra arguments after SCRIPT re-root the tree at the nested subcommand.