예제 #1
0
 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))
예제 #2
0
 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))
예제 #3
0
 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))
예제 #4
0
 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))