Only try to start the LibreOfficeServer if LibreOffice Python exists

This commit is contained in:
Raoul Snyman 2016-11-08 13:22:36 +02:00
parent 704d9118a5
commit 52c92e434b
2 changed files with 3 additions and 1 deletions

View File

@ -67,7 +67,8 @@ class MacLOController(PresentationController):
"""
libreoffice_python = '/Applications/LibreOffice.app/Contents/Resources/python'
libreoffice_server = os.path.join(os.path.dirname(__file__), 'libreofficeserver.py')
self.server_process = Popen([libreoffice_python, libreoffice_server])
if os.path.exists(libreoffice_python):
self.server_process = Popen([libreoffice_python, libreoffice_server])
@property
def client(self):

View File

@ -70,6 +70,7 @@ class TestMacLOController(TestCase, TestMixin):
mocked_process = MagicMock()
mocked_os.path.join.side_effect = lambda *x: '/'.join(x)
mocked_os.path.dirname.return_value = ''
mocked_os.path.exists.return_value = True
MockedPopen.return_value = mocked_process
# WHEN: The presentation controller object is created