forked from openlp/openlp
Fix tests
This commit is contained in:
parent
607d678780
commit
e607a95b86
@ -126,7 +126,7 @@ class TestVLCPlayer(TestCase, TestMixin):
|
|||||||
mocked_is_macosx.return_value = False
|
mocked_is_macosx.return_value = False
|
||||||
mocked_is_win.return_value = False
|
mocked_is_win.return_value = False
|
||||||
mocked_settings = MagicMock()
|
mocked_settings = MagicMock()
|
||||||
mocked_settings.value.return_value = True
|
mocked_settings.value.return_value = ''
|
||||||
MockedSettings.return_value = mocked_settings
|
MockedSettings.return_value = mocked_settings
|
||||||
mocked_qframe = MagicMock()
|
mocked_qframe = MagicMock()
|
||||||
mocked_qframe.winId.return_value = 2
|
mocked_qframe.winId.return_value = 2
|
||||||
@ -150,8 +150,9 @@ class TestVLCPlayer(TestCase, TestMixin):
|
|||||||
# THEN: The VLC widget should be set up correctly
|
# THEN: The VLC widget should be set up correctly
|
||||||
assert mocked_output_display.vlc_widget == mocked_qframe
|
assert mocked_output_display.vlc_widget == mocked_qframe
|
||||||
mocked_qframe.setFrameStyle.assert_called_with(1)
|
mocked_qframe.setFrameStyle.assert_called_with(1)
|
||||||
mocked_settings.value.assert_called_with('advanced/hide mouse')
|
mocked_settings.value.assert_any_call('advanced/hide mouse')
|
||||||
mocked_vlc.Instance.assert_called_with('--no-video-title-show --mouse-hide-timeout=0')
|
mocked_settings.value.assert_any_call('media/vlc additions')
|
||||||
|
mocked_vlc.Instance.assert_called_with('--no-video-title-show ')
|
||||||
assert mocked_output_display.vlc_instance == mocked_instance
|
assert mocked_output_display.vlc_instance == mocked_instance
|
||||||
mocked_instance.media_player_new.assert_called_with()
|
mocked_instance.media_player_new.assert_called_with()
|
||||||
assert mocked_output_display.vlc_media_player == mocked_media_player_new
|
assert mocked_output_display.vlc_media_player == mocked_media_player_new
|
||||||
@ -175,7 +176,7 @@ class TestVLCPlayer(TestCase, TestMixin):
|
|||||||
mocked_is_macosx.return_value = False
|
mocked_is_macosx.return_value = False
|
||||||
mocked_is_win.return_value = False
|
mocked_is_win.return_value = False
|
||||||
mocked_settings = MagicMock()
|
mocked_settings = MagicMock()
|
||||||
mocked_settings.value.return_value = True
|
mocked_settings.value.return_value = ''
|
||||||
MockedSettings.return_value = mocked_settings
|
MockedSettings.return_value = mocked_settings
|
||||||
mocked_qframe = MagicMock()
|
mocked_qframe = MagicMock()
|
||||||
mocked_qframe.winId.return_value = 2
|
mocked_qframe.winId.return_value = 2
|
||||||
@ -197,7 +198,7 @@ class TestVLCPlayer(TestCase, TestMixin):
|
|||||||
vlc_player.setup(mocked_output_display, mocked_controller)
|
vlc_player.setup(mocked_output_display, mocked_controller)
|
||||||
|
|
||||||
# THEN: The VLC instance should be created with the correct options
|
# THEN: The VLC instance should be created with the correct options
|
||||||
mocked_vlc.Instance.assert_called_with('--no-video-title-show --mouse-hide-timeout=0')
|
mocked_vlc.Instance.assert_called_with('--no-video-title-show ')
|
||||||
|
|
||||||
@patch('openlp.core.ui.media.vlcplayer.is_win')
|
@patch('openlp.core.ui.media.vlcplayer.is_win')
|
||||||
@patch('openlp.core.ui.media.vlcplayer.is_macosx')
|
@patch('openlp.core.ui.media.vlcplayer.is_macosx')
|
||||||
@ -213,7 +214,7 @@ class TestVLCPlayer(TestCase, TestMixin):
|
|||||||
mocked_is_macosx.return_value = False
|
mocked_is_macosx.return_value = False
|
||||||
mocked_is_win.return_value = False
|
mocked_is_win.return_value = False
|
||||||
mocked_settings = MagicMock()
|
mocked_settings = MagicMock()
|
||||||
mocked_settings.value.return_value = False
|
mocked_settings.value.return_value = ''
|
||||||
MockedSettings.return_value = mocked_settings
|
MockedSettings.return_value = mocked_settings
|
||||||
mocked_qframe = MagicMock()
|
mocked_qframe = MagicMock()
|
||||||
mocked_qframe.winId.return_value = 2
|
mocked_qframe.winId.return_value = 2
|
||||||
@ -235,7 +236,7 @@ class TestVLCPlayer(TestCase, TestMixin):
|
|||||||
vlc_player.setup(mocked_output_display, mocked_controller)
|
vlc_player.setup(mocked_output_display, mocked_controller)
|
||||||
|
|
||||||
# THEN: The VLC instance should be created with the correct options
|
# THEN: The VLC instance should be created with the correct options
|
||||||
mocked_vlc.Instance.assert_called_with('--no-video-title-show')
|
mocked_vlc.Instance.assert_called_with('--no-video-title-show ')
|
||||||
|
|
||||||
@patch('openlp.core.ui.media.vlcplayer.is_win')
|
@patch('openlp.core.ui.media.vlcplayer.is_win')
|
||||||
@patch('openlp.core.ui.media.vlcplayer.is_macosx')
|
@patch('openlp.core.ui.media.vlcplayer.is_macosx')
|
||||||
@ -863,7 +864,7 @@ class TestVLCPlayer(TestCase, TestMixin):
|
|||||||
|
|
||||||
# THEN: nothing should happen
|
# THEN: nothing should happen
|
||||||
mocked_display.vlc_media_player.is_seekable.assert_called_with()
|
mocked_display.vlc_media_player.is_seekable.assert_called_with()
|
||||||
mocked_display.vlc_media_player.set_time.assert_called_with(5000)
|
mocked_display.vlc_media_player.set_time.assert_called_with(2000)
|
||||||
|
|
||||||
def test_reset(self):
|
def test_reset(self):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user