示例#1
0
    def test_task_set_to_error_when_exception_raised(self):
        queue = get_queue()
        task = Task(name='install_plugin', cache={'plugin_id': -1})
        self.env.db.add(task)
        self.env.db.commit()

        queue.put(task.uuid)

        def check_task_status_is_error():
            self.env.db.refresh(task)
            return task.status == 'error'

        self.env.wait_for_true(check_task_status_is_error, timeout=2)
        self.assertEquals(task.progress, 100)
示例#2
0
    def test_task_set_to_error_when_exception_raised(self):
        queue = get_queue()
        task = Task(name='install_plugin', cache={'plugin_id': -1})
        self.env.db.add(task)
        self.env.db.commit()

        queue.put(task.uuid)

        def check_task_status_is_error():
            self.env.db.refresh(task)
            return task.status == 'error'

        self.env.wait_for_true(check_task_status_is_error, timeout=2)
        self.assertEquals(task.progress, 100)
示例#3
0
 def __init__(self):
     self.queue = get_queue()
示例#4
0
文件: manager.py 项目: e0ne/fuel-web
 def __init__(self):
     self.queue = get_queue()