Пример #1
0
 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)
Пример #2
0
 def test_str(self):
     char = Wizard(name="Inara")
     self.assertEqual(str(char), 'Inara')
     self.assertEqual(repr(char), '<Wizard: Inara>')
Пример #3
0
 def test_max_hp(self):
     char = Wizard(level=3, constitution=12)
     self.assertEqual(char.hp_max, 17)