Commit Graph

3 Commits

Author SHA1 Message Date
Cal Corum
b34dcc390c test: add comprehensive refractor test cases (T1-5 through T3-5)
All checks were successful
Ruff Lint / lint (pull_request) Successful in 22s
Implements all gap tests identified by PO agents across three existing
test files. No new files created — tests added to existing modules.

T1-5 (test_refractor_notifs): Expose WP-14 integration bug — minimal
stub dict {player_id, old_tier, new_tier} causes KeyError in
build_tier_up_embed because player_name/track_name use bare dict access.
Documents the bug contract so WP-14 implementers know what to fix.

T1-6 (test_refractor_commands): Divergence tripwire — imports TIER_NAMES
from both cogs.refractor and helpers.refractor_notifs and asserts deep
equality. Will fail the moment the two copies fall out of sync.

T1-7 (test_card_embed_refractor): TIER_BADGES format contract — asserts
that wrapping helpers.main badge values in brackets produces cogs.refractor
badge values (e.g. "BC" -> "[BC]") for all tiers.

T2-7 (test_refractor_notifs): notify_tier_completion with None channel
must not raise — the try/except absorbs AttributeError from None.send().

T2-8 (test_refractor_commands): All-T4 apply_close_filter returns empty
list. Documents intended behaviour for tier=4 + progress="close" combo.

T3-2 (test_refractor_commands): Malformed API response handling —
format_refractor_entry must use fallbacks ("Unknown", 0) for missing keys.

T3-3 (test_refractor_commands): Progress bar boundary precision — 1/100,
99/100, 0/100, and negative current values.

T3-4 (test_refractor_commands): RP formula label — card_type="rp" shows
"IP+K" (previously only "sp" was tested).

T3-5 (test_refractor_commands): Unknown card_type falls back to raw string
as the formula label without crashing.

112 tests pass (23 new, 89 pre-existing).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 08:59:18 -05:00
Cal Corum
fddac59f7e fix: update test mock endpoint strings to refractor/cards/ (#114)
All checks were successful
Ruff Lint / lint (pull_request) Successful in 20s
Mock routing in _patch_db_get and _failing_db_get still checked for
"evolution/cards/" after the production endpoint was renamed, causing
all badge-presence assertions to pass vacuously (evo_state=None).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 00:19:23 -05:00
Cal Corum
687b91a009 fix: rename test file and docstring to Refractor terminology
All checks were successful
Build Docker Image / build (pull_request) Successful in 1m8s
Renames tests/test_card_embed_evolution.py to tests/test_card_embed_refractor.py
and updates the module-level docstring to use "Refractor tier progression" /
"Refractor API" instead of "evolution progress" / "evolution API".

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 12:31:38 -05:00