def test_reproduce(self): """ Test to see if wolves reproduce at the right time. """ self.wolf[TIME_TO_REPR] = 0 reproduce(self.wolf, create_wolf, WOLF_GROUP) # self.assertTrue(reproduce(self.wolf, create_wolf, WOLF_GROUP)) self.assertEqual(self.wolf[TIME_TO_REPR], WOLF_REPRO_PERIOD)
def test_reproduce_nonzerotimetorepr(self): """ Negative test to check the reproduction of wolves. """ self.wolf["time_to_repr"] = 1 self.assertFalse( reproduce(self.wolf, create_wolf, wolves_created, ws.wolves))
def test_wolf_reproduce(self): """ Check if wolf can reproduce """ # Run once to initialize the attributes wolf_action(self.wolf) # Set TIME_TO_REPRODUCE to 0 for triggering reproduction self.wolf.set_attr(TIME_TO_REPRODUCE, 0) # Let wolf reproduce reproduce(self.wolf) self.assertEqual(self.wolf.get_attr(TIME_TO_REPRODUCE), DEF_TIME_TO_REPRO)
def test_sheep_reproduce(self): """ Check if sheep can reproduce """ # Run once to initialize the attributes sheep_action(self.sheep) # Set TIME_TO_REPRODUCE to 0 for triggering reproduction self.sheep.set_attr(TIME_TO_REPRODUCE, 0) # Let sheep reproduce reproduce(self.sheep) self.assertEqual(self.sheep.get_attr(TIME_TO_REPRODUCE), DEF_TIME_TO_REPRO)
def test_reproduce(self): """ Test to see if wolves reproduce at the right time. """ self.wolf["time_to_repr"] = 0 self.assertTrue( reproduce(self.wolf, create_wolf, wolves_created, ws.wolves)) self.assertEqual(self.wolf["time_to_repr"], WOLF_REPRO_PERIOD)
def test_reproduce_nonzerotimetorepr(self): """ Negative test to check the reproduction of wolves. """ self.wolf self.wolf["time_to_repr"] = 1 self.assertFalse(reproduce(self.wolf, create_wolf, wolves_created, ws.wolves))
def test_reproduce(self): """ Test to see if wolves reproduce at the right time. """ self.wolf self.wolf["time_to_repr"] = 0 self.assertTrue(reproduce(self.wolf, create_wolf, wolves_created, ws.wolves)) self.assertEqual(self.wolf["time_to_repr"], WOLF_REPRO_PERIOD)
def test_reproduce_nonzerotimetorepr(self): """ Negative test to check the reproduction of wolves. """ self.wolf[TIME_TO_REPR] = 1 self.assertFalse(reproduce(self.wolf, create_wolf, WOLF_GROUP))