class DeployStatusGUIRenderTestCase(unittest.TestCase):
    def setUp(self):

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

        self.finish_patcher = patch(
            'conjureup.controllers.deploystatus.gui.'
            'DeployStatusController.finish')
        self.mock_finish = self.finish_patcher.start()

        self.view_patcher = patch(
            'conjureup.controllers.deploystatus.gui.DeployStatusView')
        self.view_patcher.start()
        self.app_patcher = patch(
            'conjureup.controllers.deploystatus.gui.app')
        mock_app = self.app_patcher.start()
        mock_app.ui = MagicMock(name="app.ui")
        self.eventloop_patcher = patch(
            'conjureup.controllers.deploystatus.gui.EventLoop')
        self.mock_eventloop = self.eventloop_patcher.start()

        self.controller = DeployStatusController()

    def tearDown(self):
        self.utils_patcher.stop()
        self.finish_patcher.stop()
        self.view_patcher.stop()
        self.app_patcher.stop()
        self.eventloop_patcher.stop()

    def test_render(self):
        "call render"
        self.controller.render()
Пример #2
0
class DeployStatusGUIRenderTestCase(unittest.TestCase):
    def setUp(self):

        self.finish_patcher = patch('conjureup.controllers.deploystatus.gui.'
                                    'DeployStatusController.finish')
        self.mock_finish = self.finish_patcher.start()

        self.view_patcher = patch(
            'conjureup.controllers.deploystatus.gui.DeployStatusView')
        self.view_patcher.start()
        self.app_patcher = patch('conjureup.controllers.deploystatus.gui.app')
        mock_app = self.app_patcher.start()
        mock_app.ui = MagicMock(name="app.ui")
        self.eventloop_patcher = patch(
            'conjureup.controllers.deploystatus.gui.EventLoop')
        self.mock_eventloop = self.eventloop_patcher.start()

        self.controller = DeployStatusController()
        self.track_screen_patcher = patch(
            'conjureup.controllers.deploystatus.gui.track_screen')
        self.mock_track_screen = self.track_screen_patcher.start()

    def tearDown(self):
        self.finish_patcher.stop()
        self.view_patcher.stop()
        self.app_patcher.stop()
        self.eventloop_patcher.stop()
        self.track_screen_patcher.stop()

    def test_render(self):
        "call render"
        mock_future = MagicMock(name="last_deploy_action_future")
        self.controller.render(mock_future)
        mock_future.add_done_callback.assert_called_once_with(ANY)
class DeployStatusGUIRenderTestCase(unittest.TestCase):
    def setUp(self):

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

        self.finish_patcher = patch(
            'conjureup.controllers.deploystatus.gui.'
            'DeployStatusController.finish')
        self.mock_finish = self.finish_patcher.start()

        self.view_patcher = patch(
            'conjureup.controllers.deploystatus.gui.DeployStatusView')
        self.view_patcher.start()
        self.app_patcher = patch(
            'conjureup.controllers.deploystatus.gui.app')
        mock_app = self.app_patcher.start()
        mock_app.ui = MagicMock(name="app.ui")
        self.eventloop_patcher = patch(
            'conjureup.controllers.deploystatus.gui.EventLoop')
        self.mock_eventloop = self.eventloop_patcher.start()

        self.controller = DeployStatusController()

    def tearDown(self):
        self.utils_patcher.stop()
        self.finish_patcher.stop()
        self.view_patcher.stop()
        self.app_patcher.stop()
        self.eventloop_patcher.stop()

    def test_render(self):
        "call render"
        self.controller.render()
class DeployStatusGUIRenderTestCase(unittest.TestCase):
    def setUp(self):
        self.view_patcher = patch(
            'conjureup.controllers.deploystatus.gui.DeployStatusView')
        self.view_patcher.start()
        self.app_patcher = patch(
            'conjureup.controllers.deploystatus.gui.app')
        self.mock_app = self.app_patcher.start()
        self.mock_app.ui = MagicMock(name="app.ui")

        self.controller = DeployStatusController()
        self.track_screen_patcher = patch(
            'conjureup.controllers.deploystatus.gui.track_screen')
        self.mock_track_screen = self.track_screen_patcher.start()
        self.controller._wait_for_applications = MagicMock()
        self.controller._refresh = MagicMock()

    def tearDown(self):
        self.view_patcher.stop()
        self.app_patcher.stop()
        self.track_screen_patcher.stop()

    def test_render(self):
        "call render"
        self.controller.render()
        assert self.mock_app.loop.create_task.called