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:
Raoul Snyman 2013-07-18 06:54:49 +02:00 committed by Andreas Preikschat
commit 19c81c4192
2 changed files with 4 additions and 4 deletions

View File

@ -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

View File

@ -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()