def test_hero_validation_raises_typeerror_if_title_not_str(self): name = 'Bron' title = ['Dragonslayer'] mana_regeneration_rate = 2 with self.assertRaisesRegex(TypeError, 'Title must be of "str" type.'): Hero.validate_input_hero(name, title, mana_regeneration_rate)
def test_hero_validation_raises_typeerror_if_mana_regen_rate_not_int(self): name = 'Bron' title = 'Dragonslayer' mana_regeneration_rate = 'p' with self.assertRaisesRegex( TypeError, 'Mana regeneration rate must be of "int" type.'): Hero.validate_input_hero(name, title, mana_regeneration_rate)
def test_hero_validation_raises_exception_if_mana_regen_rate_negative( self): name = 'Bron' title = 'Dragonslayer' mana_regeneration_rate = -5 with self.assertRaisesRegex( ValueError, 'Mana regeneration rate cannot be negative.'): Hero.validate_input_hero(name, title, mana_regeneration_rate)