tests.test_logo module¶
Test the terminal rendition of the Click Extra brand mark.
The layout it is drawn into belongs to VersionScreen
and is tested in test_version.py. What is checked here is the mark itself: that its
geometry lands on the grid, that its palette follows the system it claims to, and
that both survive the terminal.
- tests.test_logo.SILHOUETTE_FLOOR = 2.0¶
Contrast a face must keep against either background to hold its silhouette.
Below the 3:1 WCAG asks of non-text graphics, deliberately: that threshold assumes a shape whose only cue is its edge against the page, and this one also has two neighbouring planes to be read against. What it rules out is a face disappearing.
- tests.test_logo.ARTWORK = PosixPath('/home/runner/work/click-extra/click-extra/docs/assets/logo-square.svg')¶
The SVG the terminal rendition shares its palette with.
Present in a source checkout and in the sdist, absent from the wheel, which is the whole reason
click_extra.logorepeats the colors instead of reading them.
- tests.test_logo.PLANE_NAMES = {'left': 'l', 'right': 'r', 'top': 't'}¶
How the artwork’s CSS spells the planes
click_extra.logokeys by initial.
- tests.test_logo.test_palette_matches_the_artwork()[source]¶
The terminal mark and the artwork paint the same eighteen colors.
Both are flat-shaded, so nothing calls for two palettes, and nothing but this notices when one is recolored alone.
- tests.test_logo.test_geometry_lands_on_whole_sub_pixels()[source]¶
Every vertex is an integer, so the fill has nothing to round.
A polygon landing between sub-pixels is what turns a straight edge into an irregular stair, and no amount of resolution fixes it.
- tests.test_logo.test_edges_advance_two_sub_pixels_per_row()[source]¶
The lid edges are 2:1, which is the whole reason for the projection.
The artwork is a true 30-degree isometric, whose edges advance 1.732 sub-pixels per row. No grid holds that, so it comes out as a stair of alternating two- and four-wide treads that reads as fraying. Two across per one down tiles exactly.
- tests.test_logo.test_rows_are_seated_not_floating()[source]¶
A cube rests on the two below it, rather than hovering over them.
The artwork’s own row pitch is wider than a stack allows, which shows the background between the rows. A cube meets the pair beneath it where their lids meet, exactly half a lid below their rims.
- tests.test_logo.test_mark_fits_its_declared_box()[source]¶
Every line is exactly as wide as declared, trailing blanks included.
- tests.test_logo.test_palette_follows_its_derivation()[source]¶
Every face sits at its cube’s hue and its plane’s luminance.
The palette is written out rather than computed, so it stays greppable and a designer can tune one value. Nothing but this notices a tuned value drifting off the system it claims to belong to.
- tests.test_logo.test_every_cube_shows_exactly_its_three_faces()[source]¶
The grid carries the eighteen declared colors and nothing between them.
Rasterizing the mark and reading pixels back would let the antialiaser mint colors belonging to no face, over a hundred of them at this size. Hit-testing the polygons is what keeps the count to what the palette declares.
- tests.test_logo.test_mark_keeps_its_distance_from_both_backgrounds(background)[source]¶
One palette has to serve a light terminal and a dark one.
Flat faces are what make that possible: the shape lives in the difference between a cube’s three planes, so only the silhouette has to clear the background, and that fits in the middle of the range.
- tests.test_logo.test_neighbouring_faces_survive_a_256_color_terminal()[source]¶
No two faces that touch collapse onto the same palette index.
The mark is emitted in 24-bit color, so a terminal that downsamples is the degraded case rather than the target. It still has to show six cubes.
- tests.test_logo.SCREEN_DEPENDENCIES_ARE_RELEASES = True¶
Whether the dependencies the version screen names are installed releases.
The screen’s
Built onrow prints the installed Click and Cloup versions, so a branch build widens it past the docs URL that is otherwise the longest row. The width below is a design constraint on the configuration this project ships, and the screen already falls back to the plain message when it does not fit, so asserting it against a dev string measures upstream’s version scheme rather than this package.