def __init__(self):
        self._world = World()
        configs = Configs()

        self._result = {'world_size': '{0},{1}'.format(*self._world.get_size()),
                        'plant_max_age': configs.get_plant_max_age(),
                        'plant_matured_age': configs.get_plant_matured_age(),
                        'action_delay': configs.get_robots_actions_delay(),
                        'maximum_energy': configs.get_robots_maximum_energy(),
                        'birth_required_honor': configs.get_robots_birth_required_honor()}
    def __init__(self):
        self._world = World()
        configs = Configs()

        self._result = {
            'world_size': '{0},{1}'.format(*self._world.get_size()),
            'plant_max_age': configs.get_plant_max_age(),
            'plant_matured_age': configs.get_plant_matured_age(),
            'action_delay': configs.get_robots_actions_delay(),
            'maximum_energy': configs.get_robots_maximum_energy(),
            'birth_required_honor': configs.get_robots_birth_required_honor()
        }
    def test_info(self):
        '''Test received information.'''
        action = InfoAction()
        world = World()
        configs = Configs()
        robot = Robot("test_info_action_1293", "123")

        info = action.do_action(robot, [robot.get_id()])

        self.assertEqual(info['world_size'], '{0},{1}'.format(*world.get_size()))
        self.assertEqual(info['plant_max_age'], configs.get_plant_max_age())
        self.assertEqual(info['plant_matured_age'], configs.get_plant_matured_age())
        self.assertEqual(info['action_delay'], configs.get_robots_actions_delay())
        self.assertEqual(info['birth_required_honor'], configs.get_robots_birth_required_honor())
示例#4
0
    def test_info(self):
        '''Test received information.'''
        action = InfoAction()
        world = World()
        configs = Configs()
        robot = Robot("test_info_action_1293", "123")

        info = action.do_action(robot, [robot.get_id()])

        self.assertEqual(info['world_size'],
                         '{0},{1}'.format(*world.get_size()))
        self.assertEqual(info['plant_max_age'], configs.get_plant_max_age())
        self.assertEqual(info['plant_matured_age'],
                         configs.get_plant_matured_age())
        self.assertEqual(info['action_delay'],
                         configs.get_robots_actions_delay())
        self.assertEqual(info['birth_required_honor'],
                         configs.get_robots_birth_required_honor())