示例#1
0
 def test_prob_death_is_one_if_fitness_zero(self, example_properties_w_20):
     """
     Asserts that the probability calculated from prob_death is one
     if fitness equals zero.
     """
     animal = Animal(example_properties_w_20)
     animal.weight = 0
     animal.find_fitness()
     assert animal.prob_death() == 1
示例#2
0
 def test_not_true_if_death_prob_is_one(self, example_properties_w_20):
     """
     Assert that will_animal_live does not return True if probability of
     dying is one.
     """
     animal = Animal(example_properties_w_20)
     animal.weight = 0
     animal.find_fitness()
     assert animal.will_animal_live() is not True
示例#3
0
 def test_fitness_zero_if_weight_zero(self, example_properties_w_20):
     """
     Checks that find_fitness method calculates a fitness of zero if
     weight of the animal is zero.
     """
     animal = Animal(example_properties_w_20)
     animal.weight = 0
     animal.find_fitness()
     assert animal.fitness == 0