Exemplo n.º 1
0
 def test_active_prey(self):
     new_wolf = create_wolf(1)
     prey = getPrey(new_wolf, wolfsheep.sheep)
     #isActive = isactive(prey, *args)
     self.assertEqual(prey.isactive(), True)
     eat(new_wolf, prey)
     self.assertEqual(prey.isactive(), False)  # After wolf eats the sheep, it becomes inactive
Exemplo n.º 2
0
 def setUp(self, props=None):
     set_up()
     self.wolf = create_wolf(TEST_WNAME, TEST_WNUM)
     self.sheep = create_sheep(TEST_SNAME, TEST_SNUM)
     self.wolves = get_group(WOLF_GROUP)
     self.wolves += self.wolf
     # make a new plural for sheep!
     self.sheeps = get_group(SHEEP_GROUP)
     self.sheeps += self.sheep
     get_env().place_member(self.sheep, None)
     get_env().place_member(self.wolf, None)
Exemplo n.º 3
0
 def test_create_wolf(self):
     """
      Test to see if wolf is created
     """
     new_wolf = create_wolf(1)
     self.assertEqual(new_wolf.name, AGT_WOLF_NAME + str(1))
Exemplo n.º 4
0
 def setUp(self):
     (ws.wolves, ws.sheep, ws.meadow) = set_up()
     self.wolf = create_wolf(TEST_WNUM)
     self.sheep = create_sheep(TEST_SNUM)
Exemplo n.º 5
0
 def test_eat(self):
     new_wolf = create_wolf(1)
     prey = getPrey(new_wolf, wolfsheep.sheep)
     eat(new_wolf, prey)
     self.assertEqual(new_wolf.duration, WOLF_LIFESPAN+SHEEP_LIFESPAN)
Exemplo n.º 6
0
 def test_create_wolf(self):
     new_wolf = create_wolf(1)
     self.assertEqual(new_wolf.name, AGT_WOLF_NAME + str(1))
Exemplo n.º 7
0
 def test_create_wolf(self):
     """
      Test to see if wolf is created
     """
     new_wolf = create_wolf(1)
     self.assertEqual(new_wolf.name, AGT_WOLF_NAME + str(1))
Exemplo n.º 8
0
 def setUp(self):
     (ws.wolves, ws.sheep, ws.meadow) = set_up()
     self.wolf = create_wolf(TEST_WNUM)
     self.sheep = create_sheep(TEST_SNUM)
Exemplo n.º 9
0
 def setUp(self):
     self.pa = PropArgs.create_props('wolfsheep_props',
                                     ds_file='props/wolfsheep.props.json')
     (ws.wolves, ws.sheep, ws.meadow) = set_up()
     self.wolf = create_wolf(TEST_WNUM, self.pa)
     self.sheep = create_sheep(TEST_SNUM, self.pa)