Ejemplo n.º 1
0
 def test_run_refresh_catalog(self):
     params = {}
     user = {
         'user': '******',
         'server': 'server1',
         'identity': 'identity1',
         'api_id': 'apiid1'
     }
     entity = {'objid': 'objid1'}
     data = {}
     params.update(user)
     params.update(entity)
     params.update(data)
     task = signature(
         'beehive.module.catalog.tasks_v2.refresh_catalog_task', [params],
         app=task_manager,
         queue=self.worker.get('queue'))
     res = task.apply_async()
     self.logger.debug('start task: %s' % res)
Ejemplo n.º 2
0
 def test_run_test_task(self):
     params = {}
     user = {
         'user': '******',
         'server': 'server1',
         'identity': 'identity1',
         'api_id': 'apiid1'
     }
     entity = {'objid': 'objid1'}
     data = {'x': 2, 'y': 234, 'numbers': [2, 78, 45, 90]}
     params.update(user)
     params.update(entity)
     params.update(data)
     task = signature('beehive.module.scheduler_v2.tasks.test_task',
                      [params],
                      app=task_manager,
                      queue=self.worker.get('queue'))
     res = task.apply_async()
     self.logger.debug('start task: %s' % res)
Ejemplo n.º 3
0
    def run_test_task(self, params):
        """Run test task

        :param params: task input params {'x':.., 'y':.., 'numbers':[]}
        :return: celery task instance
        :rtype: Task
        :raises ApiManagerError if query empty return error.
        """
        # verify permissions
        self.controller.check_authorization(self.objtype, self.objdef, None,
                                            'insert')

        params.update(self.get_user())
        params['objid'] = str(uuid4())
        task = signature('beehive.module.scheduler_v2.tasks.test_task',
                         [params],
                         app=self.task_manager,
                         queue=self.celery_broker_queue)
        job = task.apply_async()

        return job