Skip tests on windows.

This commit is contained in:
Tomas Groth 2014-04-22 22:13:36 +02:00
parent 87e7310e2b
commit 7980231273
3 changed files with 19 additions and 3 deletions

View File

@ -43,7 +43,16 @@ from PyQt4 import QtCore, QtGui
from openlp.core.common import translate
from openlp.plugins.media.forms.mediaclipselectordialog import Ui_MediaClipSelector
from openlp.core.lib.ui import critical_error_message_box
from openlp.core.ui.media.vendor import vlc
try:
from openlp.core.ui.media.vendor import vlc
except (ImportError, NameError, NotImplementedError):
pass
except OSError as e:
if sys.platform.startswith('win'):
if not isinstance(e, WindowsError) and e.winerror != 126:
raise
else:
raise
log = logging.getLogger(__name__)

View File

@ -278,7 +278,8 @@ class MediaMediaItem(MediaManagerItem, RegistryProperties):
check_directory_exists(self.service_path)
self.load_list(Settings().value(self.settings_section + '/media files'))
self.rebuild_players()
self.media_clip_selector_form = MediaClipSelectorForm(self, self.main_window, None)
if VLC_AVAILABLE:
self.media_clip_selector_form = MediaClipSelectorForm(self, self.main_window, None)
def rebuild_players(self):
"""

View File

@ -29,7 +29,13 @@
"""
Module to test the MediaClipSelectorForm.
"""
from unittest import TestCase
import os
from unittest import TestCase, SkipTest
from openlp.core.ui.media.vlcplayer import VLC_AVAILABLE
if os.name == 'nt' and not VLC_AVAILABLE:
raise SkipTest('Windows without VLC, skipping this test since it cannot run without vlc')
from PyQt4 import QtGui, QtTest, QtCore