Example #1
0
    def setUp(self):
        super(TestDriver, self).setUp()

        self.persistence_backends_patcher = mock.patch(
            'poppy.distributed_task.taskflow.driver.persistence_backends')
        self.persistence = self.persistence_backends_patcher.start()
        self.persistence.backend.return_value.__enter__ = mock.MagicMock()
        self.persistence.backend.return_value.__exit__ = mock.MagicMock()

        self.job_backends_patcher = mock.patch(
            'poppy.distributed_task.taskflow.driver.job_backends')
        self.job_board = self.job_backends_patcher.start()
        self.mock_board = mock.MagicMock()
        type(self.mock_board).connected = False
        self.job_board.backend.return_value.__enter__ = mock.MagicMock(
            return_value=self.mock_board
        )
        self.job_board.backend.return_value.__exit__ = mock.MagicMock()

        self.conf = cfg.ConfigOpts()
        self.distributed_task_driver = (
            driver.TaskFlowDistributedTaskDriver(self.conf))

        self.addCleanup(self.persistence_backends_patcher.stop)
        self.addCleanup(self.job_backends_patcher.stop)
Example #2
0
    def setUp(self):
        super(TestServiceController, self).setUp()

        self.conf = cfg.ConfigOpts()
        self.distributed_task_driver = (driver.TaskFlowDistributedTaskDriver(
            self.conf))
        self.mock_persistence_n_board = mock.Mock()
        self.mock_persistence_n_board.__enter__ = mock.Mock()
        self.mock_persistence_n_board.__exit__ = mock.Mock()
        self.distributed_task_driver.persistence = mock.Mock()
        self.distributed_task_driver.persistence.return_value = (
            self.mock_persistence_n_board)
        self.distributed_task_driver.job_board = mock.Mock()
        self.distributed_task_driver.job_board.return_value = (
            self.mock_persistence_n_board.copy())
Example #3
0
    def setUp(self):
        super(TestDriver, self).setUp()

        self.conf = cfg.ConfigOpts()
        self.distributed_task_driver = (driver.TaskFlowDistributedTaskDriver(
            self.conf))