Example #1
0
 def test_false_when_prob_of_killing_is_zero(self, example_properties):
     """
     Asserts that kill method returns False when prob_kill is zero.
     """
     herbivore = Herbivore(example_properties)
     carnivore = Carnivore(example_properties)
     herbivore.find_fitness()
     carnivore.fitness = 0.5
     assert carnivore.kill(herbivore) is False
Example #2
0
 def test_true_when_prob__of_killing_is_one(self, teardown_carnivore_tests,
                                            example_properties):
     """
     Asserts that kill method returns True when prob_kill is one.
     """
     herbivore = Herbivore(example_properties)
     carnivore = Carnivore(example_properties)
     herbivore.find_fitness()
     carnivore.find_fitness()
     carnivore.params["DeltaPhiMax"] = 0.1
     assert carnivore.kill(herbivore) is True