Fix Mac OS X display flags test

Fix import in pjlink tests
Skip OpenOffice test if uno isn't available, e.g., on Mac OS X

bzr-revno: 2604
This commit is contained in:
springermac@gmail.com 2016-01-11 21:27:11 +01:00 committed by Tomas Groth
commit e6959992f9
3 changed files with 7 additions and 7 deletions

View File

@ -25,10 +25,9 @@ Package to test the openlp.core.lib.projector.pjlink1 package.
from unittest import TestCase from unittest import TestCase
from mock import MagicMock, patch
from openlp.core.lib.projector.pjlink1 import PJLink1 from openlp.core.lib.projector.pjlink1 import PJLink1
from tests.functional import patch
from tests.resources.projector.data import TEST_PIN, TEST_SALT, TEST_CONNECT_AUTHENTICATE from tests.resources.projector.data import TEST_PIN, TEST_SALT, TEST_CONNECT_AUTHENTICATE
pjlink_test = PJLink1(name='test', ip='127.0.0.1', pin=TEST_PIN, no_poll=True) pjlink_test = PJLink1(name='test', ip='127.0.0.1', pin=TEST_PIN, no_poll=True)

View File

@ -142,12 +142,10 @@ class TestMainDisplay(TestCase, TestMixin):
mocked_bibles_plugin.refresh_css.assert_called_with(main_display.frame) mocked_bibles_plugin.refresh_css.assert_called_with(main_display.frame)
@skipUnless(is_macosx(), 'Can only run test on Mac OS X due to pyobjc dependency.') @skipUnless(is_macosx(), 'Can only run test on Mac OS X due to pyobjc dependency.')
def macosx_display_window_flags_state_test(self, is_macosx): def macosx_display_window_flags_state_test(self):
""" """
Test that on Mac OS X we set the proper window flags Test that on Mac OS X we set the proper window flags
""" """
if not is_macosx():
self.skipTest('Can only run test on Mac OS X due to pyobjc dependency.')
# GIVEN: A new SlideController instance on Mac OS X. # GIVEN: A new SlideController instance on Mac OS X.
self.screens.set_current_display(0) self.screens.set_current_display(0)
display = MagicMock() display = MagicMock()

View File

@ -22,10 +22,13 @@
""" """
This module contains tests for the OpenOffice/LibreOffice importer. This module contains tests for the OpenOffice/LibreOffice importer.
""" """
from unittest import TestCase from unittest import TestCase, SkipTest
from openlp.core.common import Registry from openlp.core.common import Registry
from openlp.plugins.songs.lib.importers.openoffice import OpenOfficeImport try:
from openlp.plugins.songs.lib.importers.openoffice import OpenOfficeImport
except ImportError:
raise SkipTest('Could not import OpenOfficeImport probably due to unavailability of uno')
from tests.functional import MagicMock, patch from tests.functional import MagicMock, patch
from tests.helpers.testmixin import TestMixin from tests.helpers.testmixin import TestMixin