Files
doge_cogs/tests/alignment_helpers.py
Ziad ArafatandClaude Opus 5.5 b575ab6f75 doge_alignment: chart pictures, one command group, Discord-free core
Draw the chart with ImageMagick: one 3x3 picture, or nine tiles sent as a
Components V2 media gallery (3x3), with avatars cut into circles. Names and
avatars are looked up live; people who left are greyed out.

Move all logic into doge_alignment/core, which imports neither discord.py
nor Red: immutable Chart dataclasses with pure operations, Config/YAML
storage, a view model, pure layout geometry, a Wand painter and an avatar
fetcher. The cog and a new CLI (python -m doge_alignment) are front ends.

Commands are now one hybrid `alignment` group (text and slash): show, set,
remove, prune, clear, style, export, import, admin add/remove/list. Red's
admin/mod roles, Administrators and the server owner count as admins.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GUebqhE8dK19vyn4Ct5g1L
2026-11-05 11:34:36 -07:00

25 lines
699 B
Python

"""Shared builders for the alignment tests."""
from doge_alignment.core.alignments import AlignmentName
from doge_alignment.core.chart import (
Chart,
Entry,
add_admin,
empty_chart,
place,
)
def chart_with(
*users: tuple[str, AlignmentName], admins: tuple[str, ...] = ()
) -> Chart:
"""Return a chart with ``(user id, alignment)`` pairs on it."""
chart = empty_chart()
for user_id, alignment in users:
chart = place(
chart, user_id, Entry(alignment, f"user{user_id}")
)
for admin in admins:
chart = add_admin(chart, admin)
return chart