tests.test_logo moduleΒΆ
- tests.test_logo.MIRROR = {43: ':', 58: '+'}ΒΆ
Reflecting the mark swaps its two vertical planes, left-facing for right.
- tests.test_logo.version_screen(prog_name, version)[source]ΒΆ
The screen
--versiondraws, without the styles of the theme.
- tests.test_logo.screen_lines(*args, **kwargs)[source]ΒΆ
The version screen body, stripped of ANSI and split into lines.
Drops the leading blank the screen opens on, so every assertion below indexes the mark itself.
- tests.test_logo.test_logo_is_rectangular_and_pairable()[source]ΒΆ
Rows must be equal-length and even in count, or the half-blocks desync.
- tests.test_logo.test_logo_width_is_even()[source]ΒΆ
An odd width gives the axis a column that would face both ways at once.
- tests.test_logo.test_logo_is_symmetric()[source]ΒΆ
Mirroring swaps the two vertical planes and leaves the up-facing ones.
- tests.test_logo.test_logo_uses_declared_tones_only()[source]ΒΆ
A tone with no palette entry would raise a
KeyErrormid-render.
- tests.test_logo.test_logo_carries_structure()[source]ΒΆ
The mark must shade in more than one tone.
Its structure lives entirely in the shading, so a single-tone map would render as a featureless silhouette, the failure the color gate exists to avoid.
- tests.test_logo.test_render_logo_halves_the_rows()[source]ΒΆ
Two sub-pixel rows collapse into one terminal line.
- tests.test_logo.test_render_logo_lines_are_logo_wide()[source]ΒΆ
Every line must be the same visible width, or the metadata column shears.
- tests.test_logo.test_render_logo_silhouette_is_symmetric()[source]ΒΆ
Symmetry has to survive the render, not just hold in the source map.
Only the silhouette is asserted, because shading is handed and should be: the two vertical planes catch different light, so mirroring the mark swaps them, and that difference is spent entirely on the colors.
- tests.test_logo.test_render_logo_mirrors_character_for_character()[source]ΒΆ
Half-blocks say only how much of a cell is covered, which mirrors.
- tests.test_logo.test_render_logo_leaves_transparent_runs_unstyled()[source]ΒΆ
Transparent cells stay bare spaces, never wrapped in a no-op reset.
- tests.test_logo.test_version_screen_opens_on_a_blank_line()[source]ΒΆ
Separates the mark from whatever noisier command preceded it.
- tests.test_logo.test_version_screen_aligns_the_metadata_column()[source]ΒΆ
The metadata starts at the same column on every line that carries some.
- tests.test_logo.test_version_screen_reports_the_version()[source]ΒΆ
The first metadata row is the plain-rendering version line, verbatim.
- tests.test_logo.test_logo_is_tall_enough_for_its_metadata()[source]ΒΆ
A mark shorter than the column beside it would leave the text overhanging.
- tests.test_logo.test_version_screen_needs_room(monkeypatch, columns, renders)[source]ΒΆ
A terminal too narrow for the two columns declines instead of wrapping.
- tests.test_logo.test_build_rows_are_empty_outside_a_binary()[source]ΒΆ
A source install bakes nothing, so the two rows never reach the screen.
- tests.test_logo.bake(monkeypatch)[source]ΒΆ
Fill the placeholders
click-extra prebake allwrites before a binary build.The longest values any target produces, so the width assertion below is the worst case rather than whatever this machine happens to be.
- Return type:
- tests.test_logo.test_build_rows_cost_the_screen_no_width(monkeypatch)[source]ΒΆ
A binary must still get its screen on a stock 80-column terminal.
The build metadata is stacked into two rows precisely so it never widens the layout past the
Managersrow. Joined onto one line it would, and the screen would then silently degrade to the plain message on every released binary, which is the one build nobody runs from a checkout to notice.
- tests.test_logo.test_version_screen_width_never_exceeds_the_terminal()[source]ΒΆ
The threshold is measured, not guessed: no line may overflow the width.