forked from openlp/openlp
Fix patch in tests
This commit is contained in:
parent
a880d152ec
commit
0a8d1906ce
@ -133,13 +133,13 @@ class TestMainDisplay(TestCase, TestMixin):
|
|||||||
mocked_songs_plugin.refresh_css.assert_called_with(main_display.frame)
|
mocked_songs_plugin.refresh_css.assert_called_with(main_display.frame)
|
||||||
mocked_bibles_plugin.refresh_css.assert_called_with(main_display.frame)
|
mocked_bibles_plugin.refresh_css.assert_called_with(main_display.frame)
|
||||||
|
|
||||||
@patch('openlp.core.is_macosx')
|
@patch('openlp.core.ui.maindisplay.is_macosx')
|
||||||
def macosx_non_primary_screen_window_flags_test(self, mocked_is_macosx):
|
def macosx_non_primary_screen_window_flags_test(self, is_macosx):
|
||||||
"""
|
"""
|
||||||
Test that on Mac OS X when the current screen isn't primary we use the WindowStaysOnTop window flag
|
Test that on Mac OS X when the current screen isn't primary we use the WindowStaysOnTop window flag
|
||||||
"""
|
"""
|
||||||
# GIVEN: A new SlideController instance on Mac OS X with the current display not being primary.
|
# GIVEN: A new SlideController instance on Mac OS X with the current display not being primary.
|
||||||
mocked_is_macosx.return_value = True
|
is_macosx.return_value = True
|
||||||
self.screens.set_current_display(1)
|
self.screens.set_current_display(1)
|
||||||
display = MagicMock()
|
display = MagicMock()
|
||||||
|
|
||||||
@ -151,13 +151,13 @@ class TestMainDisplay(TestCase, TestMixin):
|
|||||||
main_display.windowFlags(),
|
main_display.windowFlags(),
|
||||||
'The window flags should be Qt.WindowStaysOnTop, Qt.Window, and Qt.FramelessWindowHint.')
|
'The window flags should be Qt.WindowStaysOnTop, Qt.Window, and Qt.FramelessWindowHint.')
|
||||||
|
|
||||||
@patch('openlp.core.is_macosx')
|
@patch('openlp.core.ui.maindisplay.is_macosx')
|
||||||
def macosx_primary_screen_window_flags_test(self, mocked_is_macosx):
|
def macosx_primary_screen_window_flags_test(self, is_macosx):
|
||||||
"""
|
"""
|
||||||
Test that on Mac OS X when the current screen is primary we don't use the WindowStaysOnTop window flag
|
Test that on Mac OS X when the current screen is primary we don't use the WindowStaysOnTop window flag
|
||||||
"""
|
"""
|
||||||
# GIVEN: A new SlideController instance on Mac OS X with the current display being primary.
|
# GIVEN: A new SlideController instance on Mac OS X with the current display being primary.
|
||||||
mocked_is_macosx.return_value = True
|
is_macosx.return_value = True
|
||||||
self.screens.set_current_display(0)
|
self.screens.set_current_display(0)
|
||||||
display = MagicMock()
|
display = MagicMock()
|
||||||
|
|
||||||
@ -168,13 +168,13 @@ class TestMainDisplay(TestCase, TestMixin):
|
|||||||
self.assertEqual(QtCore.Qt.Window | QtCore.Qt.FramelessWindowHint, main_display.windowFlags(),
|
self.assertEqual(QtCore.Qt.Window | QtCore.Qt.FramelessWindowHint, main_display.windowFlags(),
|
||||||
'The window flags should be Qt.Window and Qt.FramelessWindowHint.')
|
'The window flags should be Qt.Window and Qt.FramelessWindowHint.')
|
||||||
|
|
||||||
@patch('openlp.core.is_macosx')
|
@patch('openlp.core.ui.maindisplay.is_macosx')
|
||||||
def macosx_non_primary_screen_window_state_test(self, mocked_is_macosx):
|
def macosx_non_primary_screen_window_state_test(self, is_macosx):
|
||||||
"""
|
"""
|
||||||
Test that on Mac OS X when the current screen isn't primary we don't set the window state to full screen
|
Test that on Mac OS X when the current screen isn't primary we don't set the window state to full screen
|
||||||
"""
|
"""
|
||||||
# GIVEN: A new SlideController instance on Mac OS X with the current display not being primary.
|
# GIVEN: A new SlideController instance on Mac OS X with the current display not being primary.
|
||||||
mocked_is_macosx.return_value = True
|
is_macosx.return_value = True
|
||||||
self.screens.set_current_display(1)
|
self.screens.set_current_display(1)
|
||||||
display = MagicMock()
|
display = MagicMock()
|
||||||
|
|
||||||
@ -185,13 +185,13 @@ class TestMainDisplay(TestCase, TestMixin):
|
|||||||
self.assertNotEqual(QtCore.Qt.WindowFullScreen, main_display.windowState(),
|
self.assertNotEqual(QtCore.Qt.WindowFullScreen, main_display.windowState(),
|
||||||
'The window state should not be full screen.')
|
'The window state should not be full screen.')
|
||||||
|
|
||||||
@patch('openlp.core.is_macosx')
|
@patch('openlp.core.ui.maindisplay.is_macosx')
|
||||||
def macosx_primary_screen_window_state_test(self, mocked_is_macosx):
|
def macosx_primary_screen_window_state_test(self, is_macosx):
|
||||||
"""
|
"""
|
||||||
Test that on Mac OS X when the current screen is primary we set the window state to full screen
|
Test that on Mac OS X when the current screen is primary we set the window state to full screen
|
||||||
"""
|
"""
|
||||||
# GIVEN: A new SlideController instance on Mac OS X with the current display being primary.
|
# GIVEN: A new SlideController instance on Mac OS X with the current display being primary.
|
||||||
mocked_is_macosx.return_value = True
|
is_macosx.return_value = True
|
||||||
self.screens.set_current_display(0)
|
self.screens.set_current_display(0)
|
||||||
display = MagicMock()
|
display = MagicMock()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user