コード例 #1
0
    def setUp(self):
        with patch.object(DeployController, 'init_machines_assignments'):
            self.controller = DeployController()

        self.controllers_patcher = patch(
            'conjureup.controllers.deploy.gui.controllers')
        self.mock_controllers = self.controllers_patcher.start()

        self.utils_patcher = patch('conjureup.controllers.deploy.gui.utils')
        self.mock_utils = self.utils_patcher.start()

        self.submit_patcher = patch(
            'conjureup.controllers.deploy.gui.async.submit')
        self.mock_submit = self.submit_patcher.start()
        self.mock_submit.return_value = sentinel.a_future

        self.juju_patcher = patch('conjureup.controllers.deploy.gui.juju')
        self.mock_juju = self.juju_patcher.start()

        self.render_patcher = patch(
            'conjureup.controllers.deploy.gui.DeployController.render')
        self.mock_render = self.render_patcher.start()
        self.app_patcher = patch('conjureup.controllers.deploy.gui.app')
        self.mock_app = self.app_patcher.start()
        self.mock_app.ui = MagicMock(name="app.ui")
コード例 #2
0
    def setUp(self):
        self.controller = DeployController()

        self.utils_patcher = patch('conjureup.controllers.deploy.gui.utils')
        self.mock_utils = self.utils_patcher.start()

        self.mock_bundle = MagicMock(name="bundle")
        self.mock_bundle.machines = {"1": sentinel.machine_1}
        self.mock_service_1 = MagicMock(name="s1")
        self.mock_bundle.services = [self.mock_service_1]
        self.finish_patcher = patch(
            'conjureup.controllers.deploy.gui.DeployController.finish')
        self.mock_finish = self.finish_patcher.start()

        self.submit_patcher = patch(
            'conjureup.controllers.deploy.gui.async.submit')
        self.mock_submit = self.submit_patcher.start()

        self.predeploy_call = call(self.controller._pre_deploy_exec,
                                   ANY,
                                   queue_name=sentinel.JUJU_ASYNC_QUEUE)

        self.view_patcher = patch(
            'conjureup.controllers.deploy.gui.ApplicationListView')
        self.view_patcher.start()
        self.app_patcher = patch('conjureup.controllers.deploy.gui.app')
        mock_app = self.app_patcher.start()
        mock_app.ui = MagicMock(name="app.ui")
        mock_app.metadata_controller.bundle = self.mock_bundle

        self.juju_patcher = patch('conjureup.controllers.deploy.gui.juju')
        self.mock_juju = self.juju_patcher.start()
        self.mock_juju.JUJU_ASYNC_QUEUE = sentinel.JUJU_ASYNC_QUEUE
コード例 #3
0
    def setUp(self):
        with patch.object(DeployController, 'init_machines_assignments'):
            self.controller = DeployController()

        self.controllers_patcher = patch(
            'conjureup.controllers.deploy.gui.controllers')
        self.mock_controllers = self.controllers_patcher.start()

        self.juju_patcher = patch('conjureup.controllers.deploy.gui.juju')
        self.mock_juju = self.juju_patcher.start()

        self.render_patcher = patch(
            'conjureup.controllers.deploy.gui.DeployController.render')
        self.mock_render = self.render_patcher.start()
        self.watch_patcher = patch(
            'conjureup.controllers.deploy.gui.DeployController'
            '.watch_for_deploy_complete')
        self.watch_patcher.start()
        self.app_patcher = patch('conjureup.controllers.deploy.gui.app')
        self.mock_app = self.app_patcher.start()
        self.mock_app.ui = MagicMock(name="app.ui")
        self.ev_app_patcher = patch('conjureup.events.app', self.mock_app)
        self.ev_app_patcher.start()

        self.common_patcher = patch('conjureup.controllers.deploy.gui.common')
        self.mock_common = self.common_patcher.start()
コード例 #4
0
    def setUp(self):
        with patch.object(DeployController, 'init_machines_assignments'):
            self.controller = DeployController()

        self.mock_bundle = MagicMock(name="bundle")
        self.mock_bundle.machines = {"1": sentinel.machine_1}
        self.mock_service_1 = MagicMock(name="s1")
        self.mock_bundle.services = [self.mock_service_1]
        self.finish_patcher = patch(
            'conjureup.controllers.deploy.gui.DeployController.finish')
        self.mock_finish = self.finish_patcher.start()

        self.common_patcher = patch('conjureup.controllers.deploy.gui.common')
        self.mock_common = self.common_patcher.start()

        self.view_patcher = patch(
            'conjureup.controllers.deploy.gui.ApplicationListView')
        self.view_patcher.start()
        self.app_patcher = patch('conjureup.controllers.deploy.gui.app')
        self.mock_app = self.app_patcher.start()
        self.mock_app.ui = MagicMock(name="app.ui")
        self.mock_app.metadata_controller.bundle = self.mock_bundle
        self.mock_app.current_controller = 'testcontroller'
        self.mock_app.bootstrap.running.exception.return_value = None
        self.ev_app_patcher = patch('conjureup.events.app', self.mock_app)
        self.ev_app_patcher.start()

        self.juju_patcher = patch('conjureup.controllers.deploy.gui.juju')
        self.mock_juju = self.juju_patcher.start()

        self.track_screen_patcher = patch(
            'conjureup.controllers.deploy.gui.track_screen')
        self.mock_track_screen = self.track_screen_patcher.start()
コード例 #5
0
    def setUp(self):
        self.view_patcher = patch(
            'conjureup.controllers.deploy.gui.DeployStatusView')
        self.view_patcher.start()
        self.app_patcher = patch(
            'conjureup.controllers.deploy.gui.app')
        self.mock_app = self.app_patcher.start()

        self.controller = DeployController()
        self.controller._wait_for_applications = MagicMock()
        self.controller._refresh = MagicMock()
        self.common_patcher = patch(
            'conjureup.controllers.deploy.gui.common')
        self.mock_common = self.common_patcher.start()
コード例 #6
0
    def setUp(self):
        self.controller = DeployController()

        self.controllers_patcher = patch(
            'conjureup.controllers.deploy.gui.controllers')
        self.mock_controllers = self.controllers_patcher.start()

        self.utils_patcher = patch('conjureup.controllers.deploy.gui.utils')
        self.mock_utils = self.utils_patcher.start()

        self.juju_patcher = patch('conjureup.controllers.deploy.gui.juju')
        self.mock_juju = self.juju_patcher.start()

        self.render_patcher = patch(
            'conjureup.controllers.deploy.gui.DeployController.render')
        self.mock_render = self.render_patcher.start()
        self.app_patcher = patch('conjureup.controllers.deploy.gui.app')
        self.mock_app = self.app_patcher.start()
        self.mock_app.ui = MagicMock(name="app.ui")
コード例 #7
0
    def setUp(self):
        with patch.object(DeployController, 'init_machines_assignments'):
            self.controller = DeployController()

        self.utils_patcher = patch(
            'conjureup.controllers.deploy.gui.utils')
        self.mock_utils = self.utils_patcher.start()

        self.mock_bundle = MagicMock(name="bundle")
        self.mock_bundle.machines = {"1": sentinel.machine_1}
        self.mock_service_1 = MagicMock(name="s1")
        self.mock_bundle.services = [self.mock_service_1]
        self.finish_patcher = patch(
            'conjureup.controllers.deploy.gui.DeployController.finish')
        self.mock_finish = self.finish_patcher.start()

        self.submit_patcher = patch(
            'conjureup.controllers.deploy.gui.async.submit')
        self.mock_submit = self.submit_patcher.start()

        self.predeploy_call = call(self.controller._pre_deploy_exec, ANY,
                                   queue_name=sentinel.JUJU_ASYNC_QUEUE)

        self.view_patcher = patch(
            'conjureup.controllers.deploy.gui.ApplicationListView')
        self.view_patcher.start()
        self.app_patcher = patch(
            'conjureup.controllers.deploy.gui.app')
        mock_app = self.app_patcher.start()
        mock_app.ui = MagicMock(name="app.ui")
        mock_app.metadata_controller.bundle = self.mock_bundle
        mock_app.current_controller = 'testcontroller'
        mock_app.bootstrap.running.exception.return_value = None

        self.juju_patcher = patch(
            'conjureup.controllers.deploy.gui.juju')
        self.mock_juju = self.juju_patcher.start()
        self.mock_juju.JUJU_ASYNC_QUEUE = sentinel.JUJU_ASYNC_QUEUE

        self.track_screen_patcher = patch(
            'conjureup.controllers.deploy.gui.track_screen')
        self.mock_track_screen = self.track_screen_patcher.start()
コード例 #8
0
    def setUp(self):
        self.controller = DeployController()

        self.utils_patcher = patch('conjureup.controllers.deploy.gui.utils')
        self.mock_utils = self.utils_patcher.start()

        self.bundleinfo_patcher = patch(
            'conjureup.controllers.deploy.gui.get_bundleinfo')
        self.mock_get_bundleinfo = self.bundleinfo_patcher.start()
        self.mock_bundle = MagicMock(name="bundle")
        self.mock_bundle.machines = {"1": sentinel.machine_1}
        self.mock_service_1 = MagicMock(name="s1")
        self.mock_get_bundleinfo.return_value = ("filename", self.mock_bundle,
                                                 [self.mock_service_1])
        self.finish_patcher = patch(
            'conjureup.controllers.deploy.gui.DeployController.finish')
        self.mock_finish = self.finish_patcher.start()

        self.submit_patcher = patch(
            'conjureup.controllers.deploy.gui.async.submit')
        self.mock_submit = self.submit_patcher.start()

        self.predeploy_call = call(self.controller._pre_deploy_exec,
                                   ANY,
                                   queue_name=sentinel.JUJU_ASYNC_QUEUE)

        self.view_patcher = patch(
            'conjureup.controllers.deploy.gui.ServiceWalkthroughView')
        self.view_patcher.start()
        self.app_patcher = patch('conjureup.controllers.deploy.gui.app')
        mock_app = self.app_patcher.start()
        mock_app.ui = MagicMock(name="app.ui")

        self.juju_patcher = patch('conjureup.controllers.deploy.gui.juju')
        self.mock_juju = self.juju_patcher.start()
        self.mock_juju.JUJU_ASYNC_QUEUE = sentinel.JUJU_ASYNC_QUEUE