openlp/tests/interfaces/openlp_core_ui/test_servicemanager.py
Tim Bentley 89856e0e9a Cleanup
2013-02-13 19:22:43 +00:00

42 lines
1.2 KiB
Python

"""
Package to test the openlp.core.lib package.
"""
from unittest import TestCase
from mock import MagicMock
from openlp.core.lib import Registry, ScreenList
from openlp.core.ui.mainwindow import MainWindow
from PyQt4 import QtGui
class TestStartNoteDialog(TestCase):
def setUp(self):
"""
Create the UI
"""
Registry.create()
self.app = QtGui.QApplication([])
ScreenList.create(self.app.desktop())
Registry().register(u'application', MagicMock())
self.main_window = MainWindow()
self.service_manager = Registry().get(u'service_manager')
def tearDown(self):
"""
Delete all the C++ objects at the end so that we don't have a segfault
"""
del self.main_window
del self.app
def basic_service_manager_test(self):
"""
Test the Service Manager display functionality
"""
# GIVEN: A New Service Manager instance
# WHEN I have an empty display
# THEN the count of items should be zero
self.assertEqual(self.service_manager.service_manager_list.topLevelItemCount(), 0,
u'There the service manager list is not empty ')