def test_hero_take_mana_method_gives_mana_equal_to_mana_points(self): test_obj = Hero(name="Bron", title="Dragonslayer", health=100, mana=100, mana_regeneration_rate=2) setattr(test_obj, 'mana', 25) test_obj.take_mana(50) self.assertEqual(getattr(test_obj, 'mana'), 75)
def test_hero_take_mana_method_cannot_give_more_mana_than_max(self): test_obj = Hero(name="Bron", title="Dragonslayer", health=100, mana=100, mana_regeneration_rate=2) max_mana = 100 mana_points = 200 setattr(test_obj, 'mana', 25) test_obj.take_mana(mana_points) self.assertEqual(getattr(test_obj, 'mana'), max_mana)