Пример #1
0
 def test_correct_prob_of_birth(self, example_properties_w_40):
     """
     Asserts that prob_give_birth calculates the correct probability of
     giving birth.
     """
     animal = Animal(example_properties_w_40)
     animal.find_fitness()
     assert animal.prob_give_birth(num_animals=6) == 1
Пример #2
0
 def test_prob_of_birth_if_weight_less_than_limit(self,
                                                  example_properties_w_20):
     """
     Asserts that prob_give_birth returns a probability of zero if the
     mothers weight is less than the given limit.
     """
     animal = Animal(example_properties_w_20)
     animal.find_fitness()
     assert animal.prob_give_birth(num_animals=6) == 0
Пример #3
0
 def test_prob_of_birth_with_one_animal_in_cell(self,
                                                example_properties_w_20):
     """
     Asserts that if there is only one animal in the cell, then the
     prob_give_birth method returns a probability of zero.
     """
     animal = Animal(example_properties_w_20)
     animal.find_fitness()
     assert animal.prob_give_birth(num_animals=1) == 0