def performWeatherEffectOnPokemon(self, pokemon): """ Performs the weather's effect on the Pokemon """ messages = [] if not self.immune(pokemon): messages.append("{0} was buffeted by the hail.".format(pokemon.getName())) messages += pokemon.takeRatioOfHealthAsDamage(16) messages += Weather.performWeatherEffectOnPokemon(self, pokemon) return messages
def performWeatherEffectOnPokemon(self, pokemon): """ Performs the weather's effect on the Pokemon """ messages = [] if not self.immune(pokemon): messages.append("{0} was buffeted by the hail.".format( pokemon.getName())) messages += pokemon.takeRatioOfHealthAsDamage(16) messages += Weather.performWeatherEffectOnPokemon(self, pokemon) return messages
class performWeatherEffectOnPokemon(unittest.TestCase): """ Test cases of performWeatherEffectOnPokemon """ def setUp(self): """ Build the Pokemon Battle Wrapper and weather for the test """ self.weather = Weather() self.pkmn = BuildPokemonBattleWrapper() def performWeatherEffectOnPokemonMessage(self): """ Test that performWeatherEffectOnPokemon returns the Weather's between turns message """ messages = self.weather.performWeatherEffectOnPokemon(self.pkmn) assert messages == [], "Should receive an empty between turn message for each Pokemon"
class performWeatherEffectOnPokemon(unittest.TestCase): """ Test cases of performWeatherEffectOnPokemon """ def setUp(self): """ Build the Pokemon Battle Wrapper and weather for the test """ self.weather = Weather() self.pkmn = BuildPokemonBattleWrapper() def performWeatherEffectOnPokemonMessage(self): """ Test that performWeatherEffectOnPokemon returns the Weather's between turns message """ messages = self.weather.performWeatherEffectOnPokemon(self.pkmn) assert messages == [], "Should receive an empty between turn message for each Pokemon"