def test_isactive(self): """ Test to see if isactive returns correct values for alive and dead agents. """ self.assertEqual(True, isactive(self.sheep)) self.sheep.die() self.assertEqual(False, isactive(self.sheep))
def test_eat(self): """ When wolf eats sheep, wolf gains life, sheep dies. """ eat(self.wolf, self.sheep) self.assertEqual(self.wolf.duration, WOLF_LIFESPAN + SHEEP_LIFESPAN) # the sheep should be dead! self.assertFalse(isactive(self.sheep))