openlp/tests/interfaces/openlp_core_ui/test_servicemanager.py

42 lines
1.2 KiB
Python
Raw Normal View History

2013-02-13 19:10:41 +00:00
"""
2013-02-13 19:22:43 +00:00
Package to test the openlp.core.lib package.
2013-02-13 19:10:41 +00:00
"""
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,
2013-02-13 19:22:43 +00:00
u'There the service manager list is not empty ')