Spaces:
Sleeping
Sleeping
| import pytest | |
| from engine.game.game_state import initialize_game | |
| def game(): | |
| return initialize_game(deck_type="training") | |
| def _find_id(game, cno): | |
| for k, v in game.member_db.items(): | |
| if v.card_no == cno: | |
| return k | |
| for k, v in game.live_db.items(): | |
| if v.card_no == cno: | |
| return k | |
| return None | |
| def test_strict_PL__PR_001_PR(game): | |
| cno = "PL!-PR-001-PR" | |
| cid = _find_id(game, cno) | |
| if cid is None: | |
| pytest.skip(f"{cno} not found") | |
| db = game.member_db if cid in game.member_db else game.live_db | |
| card = db[cid] | |
| assert len(card.abilities) == 1 | |
| ab0 = card.abilities[0] | |
| assert ab0.trigger == 8 | |
| assert len(ab0.conditions) == 0 | |
| assert len(ab0.effects) == 1 | |
| assert ab0.effects[0].effect_type == 29 | |
| assert ab0.effects[0].value == 1 | |
| def test_strict_PL__PR_002_PR(game): | |
| cno = "PL!-PR-002-PR" | |
| cid = _find_id(game, cno) | |
| if cid is None: | |
| pytest.skip(f"{cno} not found") | |
| db = game.member_db if cid in game.member_db else game.live_db | |
| card = db[cid] | |
| assert len(card.abilities) == 1 | |
| ab0 = card.abilities[0] | |
| assert ab0.trigger == 8 | |
| assert len(ab0.conditions) == 0 | |
| assert len(ab0.effects) == 1 | |
| assert ab0.effects[0].effect_type == 29 | |
| assert ab0.effects[0].value == 1 | |
| def test_strict_PL__PR_005_PR(game): | |
| cno = "PL!-PR-005-PR" | |
| cid = _find_id(game, cno) | |
| if cid is None: | |
| pytest.skip(f"{cno} not found") | |
| db = game.member_db if cid in game.member_db else game.live_db | |
| card = db[cid] | |
| assert len(card.abilities) == 1 | |
| ab0 = card.abilities[0] | |
| assert ab0.trigger == 1 | |
| assert len(ab0.conditions) == 1 | |
| assert len(ab0.effects) == 1 | |
| assert ab0.effects[0].effect_type == 17 | |
| assert ab0.effects[0].value == 1 | |
| def test_strict_PL__PR_006_PR(game): | |
| cno = "PL!-PR-006-PR" | |
| cid = _find_id(game, cno) | |
| if cid is None: | |
| pytest.skip(f"{cno} not found") | |
| db = game.member_db if cid in game.member_db else game.live_db | |
| card = db[cid] | |
| assert len(card.abilities) == 1 | |
| ab0 = card.abilities[0] | |
| assert ab0.trigger == 1 | |
| assert len(ab0.conditions) == 1 | |
| assert len(ab0.effects) == 1 | |
| assert ab0.effects[0].effect_type == 17 | |
| assert ab0.effects[0].value == 1 | |
| def test_strict_PL__PR_008_PR(game): | |
| cno = "PL!-PR-008-PR" | |
| cid = _find_id(game, cno) | |
| if cid is None: | |
| pytest.skip(f"{cno} not found") | |
| db = game.member_db if cid in game.member_db else game.live_db | |
| card = db[cid] | |
| assert len(card.abilities) == 1 | |
| ab0 = card.abilities[0] | |
| assert ab0.trigger == 1 | |
| assert len(ab0.conditions) == 1 | |
| assert len(ab0.effects) == 1 | |
| assert ab0.effects[0].effect_type == 17 | |
| assert ab0.effects[0].value == 1 | |
| def test_strict_PL__bp3_005_R(game): | |
| cno = "PL!-bp3-005-R" | |
| cid = _find_id(game, cno) | |
| if cid is None: | |
| pytest.skip(f"{cno} not found") | |
| db = game.member_db if cid in game.member_db else game.live_db | |
| card = db[cid] | |
| assert len(card.abilities) == 1 | |
| ab0 = card.abilities[0] | |
| assert ab0.trigger == 1 | |
| assert len(ab0.conditions) == 0 | |
| assert len(ab0.effects) == 1 | |
| assert ab0.effects[0].effect_type == 29 | |
| assert ab0.effects[0].value == 1 | |
| def test_strict_PL__bp4_001_P(game): | |
| cno = "PL!-bp4-001-P" | |
| cid = _find_id(game, cno) | |
| if cid is None: | |
| pytest.skip(f"{cno} not found") | |
| db = game.member_db if cid in game.member_db else game.live_db | |
| card = db[cid] | |
| assert len(card.abilities) == 1 | |
| ab0 = card.abilities[0] | |
| assert ab0.trigger == 2 | |
| assert len(ab0.conditions) == 1 | |
| assert len(ab0.effects) == 1 | |
| assert ab0.effects[0].effect_type == 0 | |
| assert ab0.effects[0].value == 1 | |
| def test_strict_PL__bp4_001_R(game): | |
| cno = "PL!-bp4-001-R" | |
| cid = _find_id(game, cno) | |
| if cid is None: | |
| pytest.skip(f"{cno} not found") | |
| db = game.member_db if cid in game.member_db else game.live_db | |
| card = db[cid] | |
| assert len(card.abilities) == 1 | |
| ab0 = card.abilities[0] | |
| assert ab0.trigger == 2 | |
| assert len(ab0.conditions) == 1 | |
| assert len(ab0.effects) == 1 | |
| assert ab0.effects[0].effect_type == 0 | |
| assert ab0.effects[0].value == 1 | |
| def test_strict_PL__bp4_003_P(game): | |
| cno = "PL!-bp4-003-P" | |
| cid = _find_id(game, cno) | |
| if cid is None: | |
| pytest.skip(f"{cno} not found") | |
| db = game.member_db if cid in game.member_db else game.live_db | |
| card = db[cid] | |
| assert len(card.abilities) == 1 | |
| ab0 = card.abilities[0] | |
| assert ab0.trigger == 7 | |
| assert len(ab0.conditions) == 0 | |
| assert len(ab0.effects) == 1 | |
| assert ab0.effects[0].effect_type == 5 | |
| assert ab0.effects[0].value == 1 | |
| def test_strict_PL__bp4_003_R(game): | |
| cno = "PL!-bp4-003-R" | |
| cid = _find_id(game, cno) | |
| if cid is None: | |
| pytest.skip(f"{cno} not found") | |
| db = game.member_db if cid in game.member_db else game.live_db | |
| card = db[cid] | |
| assert len(card.abilities) == 1 | |
| ab0 = card.abilities[0] | |
| assert ab0.trigger == 7 | |
| assert len(ab0.conditions) == 0 | |
| assert len(ab0.effects) == 1 | |
| assert ab0.effects[0].effect_type == 5 | |
| assert ab0.effects[0].value == 1 | |
| def test_strict_PL__bp4_004_P(game): | |
| cno = "PL!-bp4-004-P" | |
| cid = _find_id(game, cno) | |
| if cid is None: | |
| pytest.skip(f"{cno} not found") | |
| db = game.member_db if cid in game.member_db else game.live_db | |
| card = db[cid] | |
| assert len(card.abilities) == 1 | |
| ab0 = card.abilities[0] | |
| assert ab0.trigger == 1 | |
| assert len(ab0.conditions) == 1 | |
| assert len(ab0.effects) == 1 | |
| assert ab0.effects[0].effect_type == 29 | |
| assert ab0.effects[0].value == 2 | |
| def test_strict_PL__bp4_004_R(game): | |
| cno = "PL!-bp4-004-R" | |
| cid = _find_id(game, cno) | |
| if cid is None: | |
| pytest.skip(f"{cno} not found") | |
| db = game.member_db if cid in game.member_db else game.live_db | |
| card = db[cid] | |
| assert len(card.abilities) == 1 | |
| ab0 = card.abilities[0] | |
| assert ab0.trigger == 1 | |
| assert len(ab0.conditions) == 1 | |
| assert len(ab0.effects) == 1 | |
| assert ab0.effects[0].effect_type == 29 | |
| assert ab0.effects[0].value == 2 | |
| def test_strict_PL__bp4_009_P(game): | |
| cno = "PL!-bp4-009-P" | |
| cid = _find_id(game, cno) | |
| if cid is None: | |
| pytest.skip(f"{cno} not found") | |
| db = game.member_db if cid in game.member_db else game.live_db | |
| card = db[cid] | |
| assert len(card.abilities) == 1 | |
| ab0 = card.abilities[0] | |
| assert ab0.trigger == 1 | |
| assert len(ab0.conditions) == 0 | |
| assert len(ab0.effects) == 1 | |
| assert ab0.effects[0].effect_type == 19 | |
| assert ab0.effects[0].value == 1 | |
| def test_strict_PL__bp4_009_R(game): | |
| cno = "PL!-bp4-009-R" | |
| cid = _find_id(game, cno) | |
| if cid is None: | |
| pytest.skip(f"{cno} not found") | |
| db = game.member_db if cid in game.member_db else game.live_db | |
| card = db[cid] | |
| assert len(card.abilities) == 1 | |
| ab0 = card.abilities[0] | |
| assert ab0.trigger == 1 | |
| assert len(ab0.conditions) == 0 | |
| assert len(ab0.effects) == 1 | |
| assert ab0.effects[0].effect_type == 19 | |
| assert ab0.effects[0].value == 1 | |
| def test_strict_PL__bp4_016_N(game): | |
| cno = "PL!-bp4-016-N" | |
| cid = _find_id(game, cno) | |
| if cid is None: | |
| pytest.skip(f"{cno} not found") | |
| db = game.member_db if cid in game.member_db else game.live_db | |
| card = db[cid] | |
| assert len(card.abilities) == 1 | |
| ab0 = card.abilities[0] | |
| assert ab0.trigger == 1 | |
| assert len(ab0.conditions) == 1 | |
| assert len(ab0.effects) == 1 | |
| assert ab0.effects[0].effect_type == 0 | |
| assert ab0.effects[0].value == 1 | |
| def test_strict_PL__bp4_022_L(game): | |
| cno = "PL!-bp4-022-L" | |
| cid = _find_id(game, cno) | |
| if cid is None: | |
| pytest.skip(f"{cno} not found") | |
| db = game.member_db if cid in game.member_db else game.live_db | |
| card = db[cid] | |
| assert len(card.abilities) == 1 | |
| ab0 = card.abilities[0] | |
| assert ab0.trigger == 2 | |
| assert len(ab0.conditions) == 5 | |
| assert len(ab0.effects) == 1 | |
| assert ab0.effects[0].effect_type == 6 | |
| assert ab0.effects[0].value == 2 | |
| def test_strict_PL__bp4_023_L(game): | |
| cno = "PL!-bp4-023-L" | |
| cid = _find_id(game, cno) | |
| if cid is None: | |
| pytest.skip(f"{cno} not found") | |
| db = game.member_db if cid in game.member_db else game.live_db | |
| card = db[cid] | |
| assert len(card.abilities) == 1 | |
| ab0 = card.abilities[0] | |
| assert ab0.trigger == 3 | |
| assert len(ab0.conditions) == 2 | |
| assert len(ab0.effects) == 1 | |
| assert ab0.effects[0].effect_type == 0 | |
| assert ab0.effects[0].value == 1 | |
| def test_strict_PL__bp4_024_L(game): | |
| cno = "PL!-bp4-024-L" | |
| cid = _find_id(game, cno) | |
| if cid is None: | |
| pytest.skip(f"{cno} not found") | |
| db = game.member_db if cid in game.member_db else game.live_db | |
| card = db[cid] | |
| assert len(card.abilities) == 1 | |
| ab0 = card.abilities[0] | |
| assert ab0.trigger == 2 | |
| assert len(ab0.conditions) == 0 | |
| assert len(ab0.effects) == 1 | |
| assert ab0.effects[0].effect_type == 1 | |
| assert ab0.effects[0].value == 1 | |
| def test_strict_PL__pb1_011_P_P(game): | |
| cno = "PL!-pb1-011-P+" | |
| cid = _find_id(game, cno) | |
| if cid is None: | |
| pytest.skip(f"{cno} not found") | |
| db = game.member_db if cid in game.member_db else game.live_db | |
| card = db[cid] | |
| assert len(card.abilities) == 1 | |
| ab0 = card.abilities[0] | |
| assert ab0.trigger == 1 | |
| assert len(ab0.conditions) == 3 | |
| assert len(ab0.effects) == 1 | |
| assert ab0.effects[0].effect_type == 19 | |
| assert ab0.effects[0].value == 2 | |
| def test_strict_PL__pb1_011_R(game): | |
| cno = "PL!-pb1-011-R" | |
| cid = _find_id(game, cno) | |
| if cid is None: | |
| pytest.skip(f"{cno} not found") | |
| db = game.member_db if cid in game.member_db else game.live_db | |
| card = db[cid] | |
| assert len(card.abilities) == 1 | |
| ab0 = card.abilities[0] | |
| assert ab0.trigger == 1 | |
| assert len(ab0.conditions) == 3 | |
| assert len(ab0.effects) == 1 | |
| assert ab0.effects[0].effect_type == 19 | |
| assert ab0.effects[0].value == 2 | |
| def test_strict_PL__pb1_012_P_P(game): | |
| cno = "PL!-pb1-012-P+" | |
| cid = _find_id(game, cno) | |
| if cid is None: | |
| pytest.skip(f"{cno} not found") | |
| db = game.member_db if cid in game.member_db else game.live_db | |
| card = db[cid] | |
| assert len(card.abilities) == 1 | |
| ab0 = card.abilities[0] | |
| assert ab0.trigger == 1 | |
| assert len(ab0.conditions) == 0 | |
| assert len(ab0.effects) == 1 | |
| assert ab0.effects[0].effect_type == 29 | |
| assert ab0.effects[0].value == 1 | |
| def test_strict_PL__pb1_012_R(game): | |
| cno = "PL!-pb1-012-R" | |
| cid = _find_id(game, cno) | |
| if cid is None: | |
| pytest.skip(f"{cno} not found") | |
| db = game.member_db if cid in game.member_db else game.live_db | |
| card = db[cid] | |
| assert len(card.abilities) == 1 | |
| ab0 = card.abilities[0] | |
| assert ab0.trigger == 1 | |
| assert len(ab0.conditions) == 0 | |
| assert len(ab0.effects) == 1 | |
| assert ab0.effects[0].effect_type == 29 | |
| assert ab0.effects[0].value == 1 | |
| def test_strict_PL__pb1_024_N(game): | |
| cno = "PL!-pb1-024-N" | |
| cid = _find_id(game, cno) | |
| if cid is None: | |
| pytest.skip(f"{cno} not found") | |
| db = game.member_db if cid in game.member_db else game.live_db | |
| card = db[cid] | |
| assert len(card.abilities) == 1 | |
| ab0 = card.abilities[0] | |
| assert ab0.trigger == 7 | |
| assert len(ab0.conditions) == 0 | |
| assert len(ab0.effects) == 1 | |
| assert ab0.effects[0].effect_type == 5 | |
| assert ab0.effects[0].value == 1 | |
| def test_strict_PL__pb1_032_L(game): | |
| cno = "PL!-pb1-032-L" | |
| cid = _find_id(game, cno) | |
| if cid is None: | |
| pytest.skip(f"{cno} not found") | |
| db = game.member_db if cid in game.member_db else game.live_db | |
| card = db[cid] | |
| assert len(card.abilities) == 1 | |
| ab0 = card.abilities[0] | |
| assert ab0.trigger == 3 | |
| assert len(ab0.conditions) == 1 | |
| assert len(ab0.effects) == 1 | |
| assert ab0.effects[0].effect_type == 0 | |
| assert ab0.effects[0].value == 1 | |
| def test_strict_PL_HS_bp1_001_P(game): | |
| cno = "PL!HS-bp1-001-P" | |
| cid = _find_id(game, cno) | |
| if cid is None: | |
| pytest.skip(f"{cno} not found") | |
| db = game.member_db if cid in game.member_db else game.live_db | |
| card = db[cid] | |
| assert len(card.abilities) == 1 | |
| ab0 = card.abilities[0] | |
| assert ab0.trigger == 1 | |
| assert len(ab0.conditions) == 0 | |
| assert len(ab0.effects) == 1 | |
| assert ab0.effects[0].effect_type == 29 | |
| assert ab0.effects[0].value == 2 | |
| def test_strict_PL_HS_bp1_001_R(game): | |
| cno = "PL!HS-bp1-001-R" | |
| cid = _find_id(game, cno) | |
| if cid is None: | |
| pytest.skip(f"{cno} not found") | |
| db = game.member_db if cid in game.member_db else game.live_db | |
| card = db[cid] | |
| assert len(card.abilities) == 1 | |
| ab0 = card.abilities[0] | |
| assert ab0.trigger == 1 | |
| assert len(ab0.conditions) == 0 | |
| assert len(ab0.effects) == 1 | |
| assert ab0.effects[0].effect_type == 29 | |
| assert ab0.effects[0].value == 2 | |
| def test_strict_PL_HS_bp2_001_P(game): | |
| cno = "PL!HS-bp2-001-P" | |
| cid = _find_id(game, cno) | |
| if cid is None: | |
| pytest.skip(f"{cno} not found") | |
| db = game.member_db if cid in game.member_db else game.live_db | |
| card = db[cid] | |
| assert len(card.abilities) == 1 | |
| ab0 = card.abilities[0] | |
| assert ab0.trigger == 7 | |
| assert len(ab0.conditions) == 2 | |
| assert len(ab0.effects) == 1 | |
| assert ab0.effects[0].effect_type == 5 | |
| assert ab0.effects[0].value == 1 | |
| def test_strict_PL_HS_bp2_001_R(game): | |
| cno = "PL!HS-bp2-001-R" | |
| cid = _find_id(game, cno) | |
| if cid is None: | |
| pytest.skip(f"{cno} not found") | |
| db = game.member_db if cid in game.member_db else game.live_db | |
| card = db[cid] | |
| assert len(card.abilities) == 1 | |
| ab0 = card.abilities[0] | |
| assert ab0.trigger == 7 | |
| assert len(ab0.conditions) == 2 | |
| assert len(ab0.effects) == 1 | |
| assert ab0.effects[0].effect_type == 5 | |
| assert ab0.effects[0].value == 1 | |
| def test_strict_PL_HS_bp2_004_P(game): | |
| cno = "PL!HS-bp2-004-P" | |
| cid = _find_id(game, cno) | |
| if cid is None: | |
| pytest.skip(f"{cno} not found") | |
| db = game.member_db if cid in game.member_db else game.live_db | |
| card = db[cid] | |
| assert len(card.abilities) == 1 | |
| ab0 = card.abilities[0] | |
| assert ab0.trigger == 7 | |
| assert len(ab0.conditions) == 0 | |
| assert len(ab0.effects) == 1 | |
| assert ab0.effects[0].effect_type == 5 | |
| assert ab0.effects[0].value == 1 | |
| def test_strict_PL_HS_bp2_004_R(game): | |
| cno = "PL!HS-bp2-004-R" | |
| cid = _find_id(game, cno) | |
| if cid is None: | |
| pytest.skip(f"{cno} not found") | |
| db = game.member_db if cid in game.member_db else game.live_db | |
| card = db[cid] | |
| assert len(card.abilities) == 1 | |
| ab0 = card.abilities[0] | |
| assert ab0.trigger == 7 | |
| assert len(ab0.conditions) == 0 | |
| assert len(ab0.effects) == 1 | |
| assert ab0.effects[0].effect_type == 5 | |
| assert ab0.effects[0].value == 1 | |