Exemplo n.º 1
0
    def test_start_process_on_windows(self, mocked_is_win):
        """
        Test that start_process() on Windows starts the process
        """
        # GIVEN: An ImpressController object
        controller = ImpressController(plugin=self.mock_plugin)
        controller.get_com_servicemanager = MagicMock(return_value=MagicMock())

        # WHEN: start_process() is called
        controller.start_process()

        # THEN: The correct methods should have been called
        controller.get_com_servicemanager.assert_called_once()
        assert controller.manager._FlagAsMethod.call_args_list == [call('Bridge_GetStruct'),
                                                                   call('Bridge_GetValueObject')]
Exemplo n.º 2
0
    def test_start_process_on_linux(self, MockQProcess, mocked_get_uno_command, mocked_is_win):
        """
        Test that start_process() on Linux starts the process
        """
        # GIVEN: An ImpressController object
        mocked_process = MagicMock()
        MockQProcess.return_value = mocked_process
        controller = ImpressController(plugin=self.mock_plugin)

        # WHEN: start_process() is called
        controller.start_process()

        # THEN: The correct methods should have been called
        mocked_get_uno_command.assert_called_once()
        MockQProcess.assert_called_once()
        assert controller.process is mocked_process
        mocked_process.startDetached.assert_called_once_with('libreoffice')