mirror of
https://github.com/mwisnowski/mtg_python_deckbuilder.git
synced 2025-09-22 04:50:46 +02:00
feat(web): Multi-Copy modal earlier; Multi-Copy stage before lands; bump version to 2.1.1; update CHANGELOG\n\n- Modal triggers after commander selection (Step 2)\n- Multi-Copy applied first in Step 5, lands next\n- Keep mc_summary/clamp/adjustments wiring intact\n- Tests green
This commit is contained in:
parent
be672ac5d2
commit
341a216ed3
20 changed files with 1271 additions and 21 deletions
36
code/tests/test_multi_copy_detector.py
Normal file
36
code/tests/test_multi_copy_detector.py
Normal file
|
@ -0,0 +1,36 @@
|
|||
from deck_builder import builder_utils as bu
|
||||
|
||||
|
||||
class DummyBuilder:
|
||||
def __init__(self, color_identity, selected_tags=None, commander_dict=None):
|
||||
self.color_identity = color_identity
|
||||
self.selected_tags = selected_tags or []
|
||||
self.commander_dict = commander_dict or {"Themes": []}
|
||||
|
||||
|
||||
def test_detector_dragon_approach_minimal():
|
||||
b = DummyBuilder(color_identity=['R'], selected_tags=['Spellslinger'])
|
||||
results = bu.detect_viable_multi_copy_archetypes(b)
|
||||
ids = [r['id'] for r in results]
|
||||
assert 'dragons_approach' in ids
|
||||
da = next(r for r in results if r['id']=='dragons_approach')
|
||||
assert da['name'] == "Dragon's Approach"
|
||||
assert da['type_hint'] == 'noncreature'
|
||||
assert da['default_count'] == 25
|
||||
|
||||
|
||||
def test_detector_exclusive_rats_only_one():
|
||||
b = DummyBuilder(color_identity=['B'], selected_tags=['rats','aristocrats'])
|
||||
results = bu.detect_viable_multi_copy_archetypes(b)
|
||||
rat_ids = [r['id'] for r in results if r.get('exclusive_group')=='rats']
|
||||
# Detector should keep only one rats archetype in the ranked output
|
||||
assert len(rat_ids) == 1
|
||||
assert rat_ids[0] in ('relentless_rats','rat_colony')
|
||||
|
||||
|
||||
def test_detector_color_gate_blocks():
|
||||
b = DummyBuilder(color_identity=['G'], selected_tags=['Spellslinger'])
|
||||
results = bu.detect_viable_multi_copy_archetypes(b)
|
||||
ids = [r['id'] for r in results]
|
||||
# DA is red, shouldn't appear in mono-G
|
||||
assert 'dragons_approach' not in ids
|
Loading…
Add table
Add a link
Reference in a new issue