test(foundry): point golden tests at renamed sheet files
The 8 sheets in fiches_personnages/ were renamed (dropped the 'randu' suffix); the golden tests referenced the old filenames and failed.
This commit is contained in:
@@ -11,18 +11,18 @@ SHEETS_DIR = Path(__file__).resolve().parent.parent / "fiches_personnages"
|
|||||||
|
|
||||||
# Golden pins — each tuple follows the parametrize argument order below.
|
# Golden pins — each tuple follows the parametrize argument order below.
|
||||||
_GOLDENS = [
|
_GOLDENS = [
|
||||||
("harvie_randu_sheet.json", "qeqv1DtvWsApYj3e", "Harvie", 2, "Small", 15, 10, 80, 2, 0),
|
("harvie_sheet.json", "qeqv1DtvWsApYj3e", "Harvie", 2, "Small", 15, 10, 80, 2, 0),
|
||||||
("esha_randu_sheet.json", "9ZRe6qCM2Jw2vQGd", "Esha Randu", 4, "Medium", 32, 25, None, 3, 0),
|
("esha_sheet.json", "9ZRe6qCM2Jw2vQGd", "Esha Randu", 4, "Medium", 32, 25, None, 3, 0),
|
||||||
("ierlieth_randu_sheet.json", "xsyBSseBE2avH4bP", "Ierlieth", 4, "Tiny", 29, 15, None, 2, 0),
|
("ierlieth_sheet.json", "xsyBSseBE2avH4bP", "Ierlieth", 4, "Tiny", 29, 15, None, 2, 0),
|
||||||
("jeanne_randu_sheet.json", "FACxIckfWhKKC086", "Jeanne", 4, "Large", 31, 40, None, 2, 0),
|
("jeanne_sheet.json", "FACxIckfWhKKC086", "Jeanne", 4, "Large", 31, 40, None, 2, 0),
|
||||||
("misty_randu_sheet.json", "1E9HfSar4ac6ryJ5", "Misty", 4, "Medium", 31, 30, None, 5, 0),
|
("misty_sheet.json", "1E9HfSar4ac6ryJ5", "Misty", 4, "Medium", 31, 30, None, 5, 0),
|
||||||
(
|
(
|
||||||
"nairda_randu_sheet.json", "oyyhwcAfinGasDoH", "Nairda Guisenda", 4, "Medium",
|
"nairda_sheet.json", "oyyhwcAfinGasDoH", "Nairda Guisenda", 4, "Medium",
|
||||||
31, 30, None, 2, 0,
|
31, 30, None, 2, 0,
|
||||||
),
|
),
|
||||||
("oni_randu_sheet.json", "7Ga6fQh1NrqC3NbG", "Oni Triumvir", 4, "Medium", 36, 30, None, 3, 3),
|
("oni_sheet.json", "7Ga6fQh1NrqC3NbG", "Oni Triumvir", 4, "Medium", 36, 30, None, 3, 3),
|
||||||
(
|
(
|
||||||
"tammara_randu_sheet.json", "k8sPaX8AuMnn6jXc", "Tammara Cailean", 4, "Medium",
|
"tammara_sheet.json", "k8sPaX8AuMnn6jXc", "Tammara Cailean", 4, "Medium",
|
||||||
36, 30, None, 5, 0,
|
36, 30, None, 5, 0,
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
@@ -73,8 +73,8 @@ class TestAllSheetsLoad:
|
|||||||
def test_load_sheet_delegates_and_discards_report(self) -> None:
|
def test_load_sheet_delegates_and_discards_report(self) -> None:
|
||||||
# Given a real sheet
|
# Given a real sheet
|
||||||
# When loaded through the simple entry point
|
# When loaded through the simple entry point
|
||||||
combatant = load_sheet(_sheet("harvie_randu_sheet.json"))
|
combatant = load_sheet(_sheet("harvie_sheet.json"))
|
||||||
detailed, report = load_sheet_detailed(_sheet("harvie_randu_sheet.json"))
|
detailed, report = load_sheet_detailed(_sheet("harvie_sheet.json"))
|
||||||
# Then the result is identical to the detailed load
|
# Then the result is identical to the detailed load
|
||||||
assert combatant == detailed
|
assert combatant == detailed
|
||||||
assert isinstance(report, LoadReport)
|
assert isinstance(report, LoadReport)
|
||||||
@@ -82,7 +82,7 @@ class TestAllSheetsLoad:
|
|||||||
def test_attack_ids_are_indexed_over_kept_attacks(self) -> None:
|
def test_attack_ids_are_indexed_over_kept_attacks(self) -> None:
|
||||||
# Given Oni's sheet (3 kept out of 6)
|
# Given Oni's sheet (3 kept out of 6)
|
||||||
# When loaded
|
# When loaded
|
||||||
combatant, _report = load_sheet_detailed(_sheet("oni_randu_sheet.json"))
|
combatant, _report = load_sheet_detailed(_sheet("oni_sheet.json"))
|
||||||
# Then ids are indexed over the KEPT attacks only
|
# Then ids are indexed over the KEPT attacks only
|
||||||
assert [a.id for a in combatant.attacks] == [
|
assert [a.id for a in combatant.attacks] == [
|
||||||
"7Ga6fQh1NrqC3NbG:0",
|
"7Ga6fQh1NrqC3NbG:0",
|
||||||
@@ -95,7 +95,7 @@ class TestHarviePins:
|
|||||||
def test_core_stats(self) -> None:
|
def test_core_stats(self) -> None:
|
||||||
# Given Harvie's sheet
|
# Given Harvie's sheet
|
||||||
# When loaded
|
# When loaded
|
||||||
harvie = load_sheet(_sheet("harvie_randu_sheet.json"))
|
harvie = load_sheet(_sheet("harvie_sheet.json"))
|
||||||
# Then the pinned core stats hold
|
# Then the pinned core stats hold
|
||||||
assert harvie.hp_max == 15
|
assert harvie.hp_max == 15
|
||||||
assert harvie.ac.total == 14
|
assert harvie.ac.total == 14
|
||||||
@@ -107,7 +107,7 @@ class TestHarviePins:
|
|||||||
def test_talons_count_prefix(self) -> None:
|
def test_talons_count_prefix(self) -> None:
|
||||||
# Given the "2x Talons" attackName quirk
|
# Given the "2x Talons" attackName quirk
|
||||||
# When loaded
|
# When loaded
|
||||||
harvie = load_sheet(_sheet("harvie_randu_sheet.json"))
|
harvie = load_sheet(_sheet("harvie_sheet.json"))
|
||||||
talons = harvie.attacks[0]
|
talons = harvie.attacks[0]
|
||||||
# Then the prefix becomes count=2, the bonus stays as printed (no secondary -5)
|
# Then the prefix becomes count=2, the bonus stays as printed (no secondary -5)
|
||||||
assert talons.count == 2
|
assert talons.count == 2
|
||||||
@@ -121,7 +121,7 @@ class TestHarviePins:
|
|||||||
def test_bite_secondary_baked_in(self) -> None:
|
def test_bite_secondary_baked_in(self) -> None:
|
||||||
# Given the Bite entry whose -5 secondary penalty is already baked in
|
# Given the Bite entry whose -5 secondary penalty is already baked in
|
||||||
# When loaded
|
# When loaded
|
||||||
harvie = load_sheet(_sheet("harvie_randu_sheet.json"))
|
harvie = load_sheet(_sheet("harvie_sheet.json"))
|
||||||
bite = harvie.attacks[1]
|
bite = harvie.attacks[1]
|
||||||
# Then the printed -3 is kept verbatim
|
# Then the printed -3 is kept verbatim
|
||||||
assert bite.attack_bonus == -3
|
assert bite.attack_bonus == -3
|
||||||
@@ -130,7 +130,7 @@ class TestHarviePins:
|
|||||||
def test_dict_speeds_use_total(self) -> None:
|
def test_dict_speeds_use_total(self) -> None:
|
||||||
# Given land/fly encoded as {base, total} dicts
|
# Given land/fly encoded as {base, total} dicts
|
||||||
# When loaded
|
# When loaded
|
||||||
harvie = load_sheet(_sheet("harvie_randu_sheet.json"))
|
harvie = load_sheet(_sheet("harvie_sheet.json"))
|
||||||
# Then the effective totals are used
|
# Then the effective totals are used
|
||||||
assert harvie.speed_land_ft == 10
|
assert harvie.speed_land_ft == 10
|
||||||
assert harvie.speed_fly_ft == 80
|
assert harvie.speed_fly_ft == 80
|
||||||
@@ -140,7 +140,7 @@ class TestEshaPins:
|
|||||||
def test_lance_reach_and_size_roll(self) -> None:
|
def test_lance_reach_and_size_roll(self) -> None:
|
||||||
# Given the Lance with formula "sizeRoll(1, 8, @size)" and units "reach"
|
# Given the Lance with formula "sizeRoll(1, 8, @size)" and units "reach"
|
||||||
# When loaded
|
# When loaded
|
||||||
esha = load_sheet(_sheet("esha_randu_sheet.json"))
|
esha = load_sheet(_sheet("esha_sheet.json"))
|
||||||
lance = next(a for a in esha.attacks if "Lance" in a.name)
|
lance = next(a for a in esha.attacks if "Lance" in a.name)
|
||||||
# Then the Medium sizeRoll resolves to 1d8 and reach is 10 ft
|
# Then the Medium sizeRoll resolves to 1d8 and reach is 10 ft
|
||||||
assert lance.kind == "melee"
|
assert lance.kind == "melee"
|
||||||
@@ -152,7 +152,7 @@ class TestEshaPins:
|
|||||||
def test_shortbow_range_increment(self) -> None:
|
def test_shortbow_range_increment(self) -> None:
|
||||||
# Given the Composite Shortbow with units "ft" value "70"
|
# Given the Composite Shortbow with units "ft" value "70"
|
||||||
# When loaded
|
# When loaded
|
||||||
esha = load_sheet(_sheet("esha_randu_sheet.json"))
|
esha = load_sheet(_sheet("esha_sheet.json"))
|
||||||
bow = next(a for a in esha.attacks if "Shortbow" in a.name)
|
bow = next(a for a in esha.attacks if "Shortbow" in a.name)
|
||||||
# Then it is a ranged attack with a 70 ft increment and 1d6 damage
|
# Then it is a ranged attack with a 70 ft increment and 1d6 damage
|
||||||
assert bow.kind == "ranged"
|
assert bow.kind == "ranged"
|
||||||
@@ -163,7 +163,7 @@ class TestEshaPins:
|
|||||||
def test_missing_crit_range_defaults_to_20(self) -> None:
|
def test_missing_crit_range_defaults_to_20(self) -> None:
|
||||||
# Given the Earth Breaker entry which has no critRange key at all
|
# Given the Earth Breaker entry which has no critRange key at all
|
||||||
# When loaded
|
# When loaded
|
||||||
esha = load_sheet(_sheet("esha_randu_sheet.json"))
|
esha = load_sheet(_sheet("esha_sheet.json"))
|
||||||
breaker = next(a for a in esha.attacks if "Earth Breaker" in a.name)
|
breaker = next(a for a in esha.attacks if "Earth Breaker" in a.name)
|
||||||
# Then crit_range defaults to 20
|
# Then crit_range defaults to 20
|
||||||
assert breaker.crit_range == 20
|
assert breaker.crit_range == 20
|
||||||
@@ -174,14 +174,14 @@ class TestOtherSheetPins:
|
|||||||
def test_misty_has_keen_crit(self) -> None:
|
def test_misty_has_keen_crit(self) -> None:
|
||||||
# Given Misty's sheet (MWK Rapier 18-20)
|
# Given Misty's sheet (MWK Rapier 18-20)
|
||||||
# When loaded
|
# When loaded
|
||||||
misty = load_sheet(_sheet("misty_randu_sheet.json"))
|
misty = load_sheet(_sheet("misty_sheet.json"))
|
||||||
# Then at least one attack threatens on 18
|
# Then at least one attack threatens on 18
|
||||||
assert any(a.crit_range == 18 for a in misty.attacks)
|
assert any(a.crit_range == 18 for a in misty.attacks)
|
||||||
|
|
||||||
def test_misty_thrown_dagger_keeps_melee_kind_with_increment(self) -> None:
|
def test_misty_thrown_dagger_keeps_melee_kind_with_increment(self) -> None:
|
||||||
# Given the Dagger: actionType mwak but range units "ft"
|
# Given the Dagger: actionType mwak but range units "ft"
|
||||||
# When loaded
|
# When loaded
|
||||||
misty = load_sheet(_sheet("misty_randu_sheet.json"))
|
misty = load_sheet(_sheet("misty_sheet.json"))
|
||||||
dagger = next(a for a in misty.attacks if "Dagger" in a.name)
|
dagger = next(a for a in misty.attacks if "Dagger" in a.name)
|
||||||
# Then kind comes from actionType and the increment is still recorded
|
# Then kind comes from actionType and the increment is still recorded
|
||||||
assert dagger.kind == "melee"
|
assert dagger.kind == "melee"
|
||||||
@@ -190,14 +190,14 @@ class TestOtherSheetPins:
|
|||||||
def test_tammara_has_x4_crit(self) -> None:
|
def test_tammara_has_x4_crit(self) -> None:
|
||||||
# Given Tammara's pistols (x4 crit)
|
# Given Tammara's pistols (x4 crit)
|
||||||
# When loaded
|
# When loaded
|
||||||
tammara = load_sheet(_sheet("tammara_randu_sheet.json"))
|
tammara = load_sheet(_sheet("tammara_sheet.json"))
|
||||||
# Then at least one attack multiplies by 4
|
# Then at least one attack multiplies by 4
|
||||||
assert any(a.crit_mult == 4 for a in tammara.attacks)
|
assert any(a.crit_mult == 4 for a in tammara.attacks)
|
||||||
|
|
||||||
def test_tammara_touch_attack_kind(self) -> None:
|
def test_tammara_touch_attack_kind(self) -> None:
|
||||||
# Given the Alchemist's Fire with actionType twak
|
# Given the Alchemist's Fire with actionType twak
|
||||||
# When loaded
|
# When loaded
|
||||||
tammara = load_sheet(_sheet("tammara_randu_sheet.json"))
|
tammara = load_sheet(_sheet("tammara_sheet.json"))
|
||||||
fire = next(a for a in tammara.attacks if "Alchemist" in a.name)
|
fire = next(a for a in tammara.attacks if "Alchemist" in a.name)
|
||||||
# Then it maps to a touch attack
|
# Then it maps to a touch attack
|
||||||
assert fire.kind == "touch"
|
assert fire.kind == "touch"
|
||||||
@@ -206,7 +206,7 @@ class TestOtherSheetPins:
|
|||||||
def test_oni_keeps_exactly_three_attacks(self) -> None:
|
def test_oni_keeps_exactly_three_attacks(self) -> None:
|
||||||
# Given Oni's sheet with 3 invalid entries among 6
|
# Given Oni's sheet with 3 invalid entries among 6
|
||||||
# When loaded
|
# When loaded
|
||||||
oni, report = load_sheet_detailed(_sheet("oni_randu_sheet.json"))
|
oni, report = load_sheet_detailed(_sheet("oni_sheet.json"))
|
||||||
# Then exactly 3 attacks are kept
|
# Then exactly 3 attacks are kept
|
||||||
assert len(oni.attacks) == 3
|
assert len(oni.attacks) == 3
|
||||||
assert report.kept == 3
|
assert report.kept == 3
|
||||||
@@ -214,7 +214,7 @@ class TestOtherSheetPins:
|
|||||||
def test_oni_skipped_entries_have_reasons(self) -> None:
|
def test_oni_skipped_entries_have_reasons(self) -> None:
|
||||||
# Given Oni's sheet
|
# Given Oni's sheet
|
||||||
# When loaded
|
# When loaded
|
||||||
_oni, report = load_sheet_detailed(_sheet("oni_randu_sheet.json"))
|
_oni, report = load_sheet_detailed(_sheet("oni_sheet.json"))
|
||||||
skipped = {entry.weapon: entry.reason for entry in report.skipped}
|
skipped = {entry.weapon: entry.reason for entry in report.skipped}
|
||||||
# Then each skipped entry is recorded with its reason
|
# Then each skipped entry is recorded with its reason
|
||||||
assert set(skipped) == {"Channel Energy", "une Pioche", "Weapon"}
|
assert set(skipped) == {"Channel Energy", "une Pioche", "Weapon"}
|
||||||
@@ -225,7 +225,7 @@ class TestOtherSheetPins:
|
|||||||
def test_jeanne_count_prefix_and_dict_speed(self) -> None:
|
def test_jeanne_count_prefix_and_dict_speed(self) -> None:
|
||||||
# Given Jeanne ("2x Hooves", land {base 50, total 40})
|
# Given Jeanne ("2x Hooves", land {base 50, total 40})
|
||||||
# When loaded
|
# When loaded
|
||||||
jeanne = load_sheet(_sheet("jeanne_randu_sheet.json"))
|
jeanne = load_sheet(_sheet("jeanne_sheet.json"))
|
||||||
hooves = jeanne.attacks[0]
|
hooves = jeanne.attacks[0]
|
||||||
# Then the count prefix and the effective speed are applied
|
# Then the count prefix and the effective speed are applied
|
||||||
assert hooves.count == 2
|
assert hooves.count == 2
|
||||||
@@ -235,7 +235,7 @@ class TestOtherSheetPins:
|
|||||||
def test_ierlieth_land_dict_uses_total_not_base(self) -> None:
|
def test_ierlieth_land_dict_uses_total_not_base(self) -> None:
|
||||||
# Given Ierlieth's land speed {base 20, total 15}
|
# Given Ierlieth's land speed {base 20, total 15}
|
||||||
# When loaded
|
# When loaded
|
||||||
ierlieth = load_sheet(_sheet("ierlieth_randu_sheet.json"))
|
ierlieth = load_sheet(_sheet("ierlieth_sheet.json"))
|
||||||
# Then the effective value wins
|
# Then the effective value wins
|
||||||
assert ierlieth.speed_land_ft == 15
|
assert ierlieth.speed_land_ft == 15
|
||||||
assert ierlieth.size == "Tiny"
|
assert ierlieth.size == "Tiny"
|
||||||
@@ -243,6 +243,6 @@ class TestOtherSheetPins:
|
|||||||
def test_nairda_negative_damage_bonus_preserved(self) -> None:
|
def test_nairda_negative_damage_bonus_preserved(self) -> None:
|
||||||
# Given Nairda's unarmed strike with damageBonus -1
|
# Given Nairda's unarmed strike with damageBonus -1
|
||||||
# When loaded
|
# When loaded
|
||||||
nairda = load_sheet(_sheet("nairda_randu_sheet.json"))
|
nairda = load_sheet(_sheet("nairda_sheet.json"))
|
||||||
# Then the negative bonus is preserved (low STR)
|
# Then the negative bonus is preserved (low STR)
|
||||||
assert nairda.attacks[0].damage_bonus == -1
|
assert nairda.attacks[0].damage_bonus == -1
|
||||||
|
|||||||
Reference in New Issue
Block a user