File size: 1,393 Bytes
bb3fbf9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from compiler.parser import AbilityParser
from engine.models.ability import EffectType


def test_pl_pr_001_pr_recovery():
    """

    Test PL!-PR-001-PR ability text:

    '{{jidou.png|自動}}このメンバーがステージから控え室に置かれたとき、あなたの控え室の「アクティブにする」を持つメンバーを1枚手札に加えてもよい。'



    Expected:

    - Trigger: ON_LEAVES

    - Effect: RECOVER_MEMBER (or ADD_TO_HAND from discard)

    - Filter: has_ability='active'

    - Should NOT contain EffectType.ACTIVATE_MEMBER

    """
    text = "{{jidou.png|自動}}このメンバーがステージから控え室に置かれたとき、あなたの控え室の「アクティブにする」を持つメンバーを1枚手札に加えてもよい。"
    abilities = AbilityParser.parse_ability_text(text)

    assert len(abilities) == 1
    ab = abilities[0]

    # Check trigger
    assert ab.trigger == 8  # TriggerType.ON_LEAVES

    # Check effect is retrieval, not activation
    assert len(ab.effects) == 1
    eff = ab.effects[0]

    assert eff.effect_type in [EffectType.RECOVER_MEMBER, EffectType.ADD_TO_HAND]
    assert eff.params.get("from") == "discard"
    assert eff.params.get("has_ability") == "active"

    # Ensure NO Activate effect (ID 29)
    assert eff.effect_type != EffectType.ACTIVATE_MEMBER