openlp/tests/interfaces/openlp_core_ui/test_servicemanager.py

44 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
"""
2013-02-16 06:51:25 +00:00
from unittest import TestCase
2013-02-13 19:10:41 +00:00
from mock import MagicMock
2013-02-16 06:51:25 +00:00
from PyQt4 import QtGui
2013-02-13 19:10:41 +00:00
from openlp.core.lib import Registry, ScreenList
from openlp.core.ui.mainwindow import MainWindow
class TestStartNoteDialog(TestCase):
def setUp(self):
"""
Create the UI
"""
Registry.create()
2013-02-16 15:02:19 +00:00
self.app = QtGui.QApplication.instance()
2013-02-13 19:10:41 +00:00
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-16 10:17:48 +00:00
u'The service manager list should be empty ')