mirror of
https://github.com/Threnklyn/dungeon-sheets.git
synced 2026-05-18 20:23:27 +02:00
Fix failing character.py tests
This commit is contained in:
@@ -64,7 +64,7 @@ class TestCharacter(TestCase):
|
||||
self.assertEqual(char.spells[0].name, "my spell!")
|
||||
|
||||
def test_homebrew_infusions(self):
|
||||
char = Character(class_list="artificer")
|
||||
char = Character(classes="artificer")
|
||||
|
||||
class MyInfusion(infusions.Infusion):
|
||||
name = "my infusion!"
|
||||
@@ -74,7 +74,7 @@ class TestCharacter(TestCase):
|
||||
self.assertIsInstance(char.infusions[0], infusions.Infusion)
|
||||
self.assertEqual(char.infusions[0].name, "my infusion!")
|
||||
# Pass a previously undefined infusion
|
||||
char = Character(class_list="artificer")
|
||||
char = Character(classes="artificer")
|
||||
char.set_attrs(infusions=("spam_infusion",))
|
||||
self.assertIsInstance(char.infusions[0], infusions.Infusion)
|
||||
self.assertEqual(char.infusions[0].name, "Spam Infusion")
|
||||
@@ -129,7 +129,7 @@ class TestCharacter(TestCase):
|
||||
self.assertEqual(repr(char), "<Wizard: Inara>")
|
||||
|
||||
def test_is_proficient(self):
|
||||
char = Character(class_list=["Wizard"])
|
||||
char = Character(classes=["Wizard"])
|
||||
char.weapon_proficiencies
|
||||
sword = Shortsword()
|
||||
# Check for not-proficient weapon
|
||||
|
||||
@@ -13,24 +13,24 @@ class TestMulticlass(TestCase):
|
||||
|
||||
def test_constructor(self):
|
||||
char = Character(
|
||||
name="Multiclass", class_list=["wizard", "fighter"], levels=[5, 4]
|
||||
name="Multiclass", classes=["wizard", "fighter"], levels=[5, 4]
|
||||
)
|
||||
self.assertIsInstance(char, Character)
|
||||
|
||||
def test_level(self):
|
||||
char = Character(
|
||||
name="Multiclass", class_list=["wizard", "fighter"], levels=[5, 4]
|
||||
name="Multiclass", classes=["wizard", "fighter"], levels=[5, 4]
|
||||
)
|
||||
self.assertEqual(char.level, 9)
|
||||
|
||||
def test_spellcasting(self):
|
||||
char = Character(
|
||||
name="Multiclass", class_list=["wizard", "fighter"], levels=[5, 4]
|
||||
name="Multiclass", classes=["wizard", "fighter"], levels=[5, 4]
|
||||
)
|
||||
self.assertEqual(len(char.spellcasting_classes), 1)
|
||||
char = Character(
|
||||
name="Multiclass",
|
||||
class_list=["wizard", "fighter"],
|
||||
classes=["wizard", "fighter"],
|
||||
subclasses=[None, "Eldritch Knight"],
|
||||
levels=[5, 4],
|
||||
)
|
||||
@@ -43,12 +43,12 @@ class TestMulticlass(TestCase):
|
||||
|
||||
def test_proficiencies(self):
|
||||
char1 = Character(
|
||||
name="Multiclass", class_list=["wizard", "fighter"], levels=[5, 4]
|
||||
name="Multiclass", classes=["wizard", "fighter"], levels=[5, 4]
|
||||
)
|
||||
for svt in ("intelligence", "wisdom"):
|
||||
self.assertIn(svt, char1.saving_throw_proficiencies)
|
||||
char2 = Character(name="Multiclass", class_list=["wizard", "rogue"], levels=[5, 4])
|
||||
char3 = Character(name="Multiclass", class_list=["rogue", "wizard"], levels=[4, 5])
|
||||
char2 = Character(name="Multiclass", classes=["wizard", "rogue"], levels=[5, 4])
|
||||
char3 = Character(name="Multiclass", classes=["rogue", "wizard"], levels=[4, 5])
|
||||
sword = Shortsword()
|
||||
self.assertTrue(char1.is_proficient(sword))
|
||||
# multiclassing into Rogue doesn't give simple weapon proficiency
|
||||
|
||||
Reference in New Issue
Block a user