forked from openlp/openlp
Fix up the build_file_mask_string test.
- Fix up the build_file_mask_string test by mocking out the __init__() method of the PresentationMediaItem class - Change the way of calling the parent __init__() method to something slightly better (though it has nothing to do with the test)
This commit is contained in:
commit
19c81c4192
@ -59,7 +59,7 @@ class PresentationMediaItem(MediaManagerItem):
|
||||
self.controllers = controllers
|
||||
self.icon_path = u'presentations/presentation'
|
||||
self.Automatic = u''
|
||||
MediaManagerItem.__init__(self, parent, plugin)
|
||||
super(PresentationMediaItem, self).__init__(parent, plugin)
|
||||
self.message_listener = MessageListener(self)
|
||||
self.has_search = True
|
||||
self.single_service_item = False
|
||||
|
@ -26,9 +26,9 @@ class TestMediaItem(TestCase):
|
||||
Registry().register(u'service_manager', MagicMock())
|
||||
Registry().register(u'main_window', MagicMock())
|
||||
|
||||
with patch('openlp.core.lib.mediamanageritem.MediaManagerItem.__init__'), \
|
||||
patch('openlp.core.lib.mediamanageritem.ListWidgetWithDnD'):
|
||||
self.media_item = PresentationMediaItem(MagicMock(), MagicMock(), MagicMock(), MagicMock())
|
||||
with patch('openlp.plugins.presentations.lib.mediaitem.PresentationMediaItem.__init__') as mocked_init:
|
||||
mocked_init.return_value = None
|
||||
self.media_item = PresentationMediaItem(MagicMock(), MagicMock, MagicMock(), MagicMock())
|
||||
|
||||
self.application = QtGui.QApplication.instance()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user