def test_spell_slots(self): char = Wizard() # Wizard level 1 char.level = 1 self.assertEqual(char.spell_slots(spell_level=0), 3) self.assertEqual(char.spell_slots(spell_level=1), 2) self.assertEqual(char.spell_slots(spell_level=2), 0) # Wizard level 2 char.level = 2 self.assertEqual(char.spell_slots(spell_level=0), 3) self.assertEqual(char.spell_slots(spell_level=1), 3) self.assertEqual(char.spell_slots(spell_level=2), 0)
def test_str(self): char = Wizard(name="Inara") self.assertEqual(str(char), 'Inara') self.assertEqual(repr(char), '<Wizard: Inara>')
def test_max_hp(self): char = Wizard(level=3, constitution=12) self.assertEqual(char.hp_max, 17)