def test_queen_place(self): colony_queen = ants.Place('Original Queen Location of the Colony') ant_queen = ants.Place('Place given to the QueenAnt') queen_place = ants.QueenPlace(colony_queen, ant_queen) colony_queen.bees = [ants.Bee(1, colony_queen) for _ in range(3)] ant_queen.bees = [ants.Bee(2, colony_queen) for _ in range(4)] self.assertEqual(7, len(queen_place.bees), 'QueenPlace has wrong bees') bee_armor = sum(bee.armor for bee in queen_place.bees) self.assertEqual(11, bee_armor, 'QueenPlace has wrong bees')
def setUp(self): AntTest.setUp(self) self.place = ants.Place('TestProblem8') self.bodyguard = ants.BodyguardAnt() self.bodyguard2 = ants.BodyguardAnt() self.test_ant = ants.Ant() self.test_ant2 = ants.Ant() self.harvester = ants.HarvesterAnt()
def setUp(self): AntTest.setUp(self) self.place = ants.Place('TestProblem8') self.bush = ants.BushAnt() self.bush2 = ants.BushAnt() self.test_ant = ants.Ant() self.test_ant2 = ants.Ant() self.harvester = ants.HarvesterAnt()