forked from openlp/openlp
54 lines
2.5 KiB
Python
54 lines
2.5 KiB
Python
|
# -*- coding: utf-8 -*-
|
||
|
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
|
||
|
|
||
|
###############################################################################
|
||
|
# OpenLP - Open Source Lyrics Projection #
|
||
|
# --------------------------------------------------------------------------- #
|
||
|
# Copyright (c) 2008-2015 OpenLP Developers #
|
||
|
# --------------------------------------------------------------------------- #
|
||
|
# This program is free software; you can redistribute it and/or modify it #
|
||
|
# under the terms of the GNU General Public License as published by the Free #
|
||
|
# Software Foundation; version 2 of the License. #
|
||
|
# #
|
||
|
# This program is distributed in the hope that it will be useful, but WITHOUT #
|
||
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
|
||
|
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
|
||
|
# more details. #
|
||
|
# #
|
||
|
# You should have received a copy of the GNU General Public License along #
|
||
|
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
|
||
|
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||
|
###############################################################################
|
||
|
"""
|
||
|
Package to test the openlp.core.ui.media.vlcplayer package.
|
||
|
"""
|
||
|
import os
|
||
|
|
||
|
from unittest import TestCase
|
||
|
from tests.functional import patch
|
||
|
|
||
|
from openlp.core.ui.media.vlcplayer import get_vlc
|
||
|
|
||
|
|
||
|
class TestVLCPlayer(TestCase):
|
||
|
"""
|
||
|
Test the functions in the :mod:`vlcplayer` module.
|
||
|
"""
|
||
|
|
||
|
@patch.dict(os.environ)
|
||
|
@patch('openlp.core.ui.media.vlcplayer.is_macosx')
|
||
|
def fix_vlc_22_plugin_path_test(self, mocked_is_macosx):
|
||
|
"""
|
||
|
Test that on OS X we set the VLC plugin path to fix a bug in the VLC module
|
||
|
"""
|
||
|
# GIVEN: We're on OS X
|
||
|
mocked_is_macosx.return_value = True
|
||
|
|
||
|
# WHEN: An checking if the player is available
|
||
|
get_vlc()
|
||
|
|
||
|
# THEN: The extra environment variable should be there
|
||
|
self.assertIn('VLC_PLUGIN_PATH', os.environ,
|
||
|
'The plugin path should be in the environment variables')
|
||
|
self.assertEqual('/Applications/VLC.app/Contents/MacOS/plugins', os.environ['VLC_PLUGIN_PATH'])
|