forked from openlp/openlp
cleaned code
This commit is contained in:
parent
479244fde2
commit
bea5fe2596
@ -5,4 +5,9 @@ sip.setapi(u'QString', 2)
|
||||
sip.setapi(u'QTextStream', 2)
|
||||
sip.setapi(u'QTime', 2)
|
||||
sip.setapi(u'QUrl', 2)
|
||||
sip.setapi(u'QVariant', 2)
|
||||
sip.setapi(u'QVariant', 2)
|
||||
|
||||
from PyQt4 import QtGui
|
||||
|
||||
# Only one QApplication can be created. Use QtGui.QApplication.instance() when you need to "create" a QApplication.
|
||||
application = QtGui.QApplication([])
|
||||
|
@ -20,10 +20,16 @@ class TestImageManager(TestCase):
|
||||
Create the UI
|
||||
"""
|
||||
Registry.create()
|
||||
self.app = QtGui.QApplication([])
|
||||
self.app = QtGui.QApplication.instance()
|
||||
ScreenList.create(self.app.desktop())
|
||||
self.image_manager = ImageManager()
|
||||
|
||||
def tearDown(self):
|
||||
"""
|
||||
Delete all the C++ objects at the end so that we don't have a segfault
|
||||
"""
|
||||
del self.app
|
||||
|
||||
def basic_image_manager_test(self):
|
||||
"""
|
||||
Test the Image Manager setup basic functionality
|
||||
|
@ -19,6 +19,11 @@ class TestScreenList(TestCase):
|
||||
self.application = QtGui.QApplication.instance()
|
||||
self.screens = ScreenList.create(self.application.desktop())
|
||||
|
||||
def tearDown(self):
|
||||
"""
|
||||
"""
|
||||
del self.application
|
||||
|
||||
def add_desktop_test(self):
|
||||
"""
|
||||
Test to check if new monitors are detected by OpenLP (= plugged in while OpenLP is running).
|
||||
|
@ -15,7 +15,7 @@ class TestStartFileRenameForm(TestCase):
|
||||
Create the UI
|
||||
"""
|
||||
registry = Registry.create()
|
||||
self.app = QtGui.QApplication([])
|
||||
self.app = QtGui.QApplication.instance()
|
||||
self.main_window = QtGui.QMainWindow()
|
||||
Registry().register(u'main_window', self.main_window)
|
||||
self.form = filerenameform.FileRenameForm()
|
||||
|
@ -18,7 +18,7 @@ class TestStartNoteDialog(TestCase):
|
||||
Create the UI
|
||||
"""
|
||||
Registry.create()
|
||||
self.app = QtGui.QApplication([])
|
||||
self.app = QtGui.QApplication.instance()
|
||||
ScreenList.create(self.app.desktop())
|
||||
Registry().register(u'application', MagicMock())
|
||||
self.main_window = MainWindow()
|
||||
|
@ -17,7 +17,7 @@ class TestStartNoteDialog(TestCase):
|
||||
Create the UI
|
||||
"""
|
||||
Registry.create()
|
||||
self.app = QtGui.QApplication([])
|
||||
self.app = QtGui.QApplication.instance()
|
||||
self.main_window = QtGui.QMainWindow()
|
||||
Registry().register(u'main_window', self.main_window)
|
||||
self.form = servicenoteform.ServiceNoteForm()
|
||||
@ -66,4 +66,4 @@ class TestStartNoteDialog(TestCase):
|
||||
QtTest.QTest.mouseClick(okWidget, QtCore.Qt.LeftButton)
|
||||
|
||||
# THEN the following text is returned
|
||||
self.assertEqual(self.form.text_edit.toPlainText(), text, u'The new text should be returned')
|
||||
self.assertEqual(self.form.text_edit.toPlainText(), text, u'The new text should be returned')
|
||||
|
@ -17,7 +17,7 @@ class TestStartTimeDialog(TestCase):
|
||||
Create the UI
|
||||
"""
|
||||
Registry.create()
|
||||
self.app = QtGui.QApplication([])
|
||||
self.app = QtGui.QApplication.instance()
|
||||
self.main_window = QtGui.QMainWindow()
|
||||
Registry().register(u'main_window', self.main_window)
|
||||
self.form = starttimeform.StartTimeForm()
|
||||
@ -93,4 +93,4 @@ class TestStartTimeDialog(TestCase):
|
||||
self.assertEqual(self.form.hourSpinBox.value(), 0)
|
||||
self.assertEqual(self.form.minuteSpinBox.value(), 2)
|
||||
self.assertEqual(self.form.secondSpinBox.value(), 3)
|
||||
self.assertEqual(self.form.item[u'service_item'].start_time, 123, u'The start time should have changed')
|
||||
self.assertEqual(self.form.item[u'service_item'].start_time, 123, u'The start time should have changed')
|
||||
|
Loading…
Reference in New Issue
Block a user