def test_calculate_willpower_state_impaired_mixed(self): # Mixed damage should return impaired result = DamageCalculator.calculate_new_willpower_state( max_willpower=5, new_aggravated_damage=3, new_superficial_damage=2) self.assertEquals(result, WILLPOWER_STATE_IMPAIRED)
def test_calculate_willpower_state_impaired(self): # Aggravated damage shouldn't change this result = DamageCalculator.calculate_new_willpower_state( max_willpower=5, new_aggravated_damage=1, new_superficial_damage=4) self.assertEquals(result, WILLPOWER_STATE_IMPAIRED)
def test_calculate_willpower_state_healthy_superficial(self): # Willpower state is healthy until damage of both types added together exceeds the tracker result = DamageCalculator.calculate_new_willpower_state( max_willpower=5, new_aggravated_damage=0, new_superficial_damage=4) self.assertEquals(result, WILLPOWER_STATE_HEALTHY)
def test_calculate_willpower_state_healthy_superficial_maxed(self): # When damage taken = willpower, we should get impaired result = DamageCalculator.calculate_new_willpower_state( max_willpower=5, new_aggravated_damage=0, new_superficial_damage=5) self.assertEquals(result, WILLPOWER_STATE_IMPAIRED)
def test_calculate_willpower_state_healthy(self): # full Willpower result = DamageCalculator.calculate_new_willpower_state( max_willpower=5, new_aggravated_damage=0, new_superficial_damage=0) self.assertEquals(result, WILLPOWER_STATE_HEALTHY)