forked from openlp/openlp
Test fixes
This commit is contained in:
parent
d1f7900ed4
commit
536bee40d4
@ -16,7 +16,7 @@ class TestRegistry(TestCase):
|
||||
Test the registry creation and its usage
|
||||
"""
|
||||
# GIVEN: A new registry
|
||||
registry = Registry.create()
|
||||
Registry.create()
|
||||
|
||||
# WHEN: I add a component it should save it
|
||||
mock_1 = MagicMock()
|
||||
|
@ -14,7 +14,7 @@ class TestStartNoteDialog(TestCase):
|
||||
"""
|
||||
Create the UI
|
||||
"""
|
||||
registry = Registry.create()
|
||||
Registry.create()
|
||||
self.app = QtGui.QApplication([])
|
||||
self.main_window = QtGui.QMainWindow()
|
||||
Registry().register(u'main_window', self.main_window)
|
||||
@ -36,7 +36,7 @@ class TestStartNoteDialog(TestCase):
|
||||
self.form.text_edit.setPlainText(u'')
|
||||
|
||||
# WHEN displaying the UI and pressing enter
|
||||
with patch(u'PyQt4.QtGui.QDialog') as mocked_exec:
|
||||
with patch(u'PyQt4.QtGui.QDialog.exec_'):
|
||||
self.form.exec_()
|
||||
okWidget = self.form.button_box.button(self.form.button_box.Save)
|
||||
QtTest.QTest.mouseClick(okWidget, QtCore.Qt.LeftButton)
|
||||
@ -47,7 +47,7 @@ class TestStartNoteDialog(TestCase):
|
||||
# WHEN displaying the UI, having set the text and pressing enter
|
||||
text = u'OpenLP is the best worship software'
|
||||
self.form.text_edit.setPlainText(text)
|
||||
with patch(u'PyQt4.QtGui.QDialog') as mocked_exec:
|
||||
with patch(u'PyQt4.QtGui.QDialog.exec_'):
|
||||
self.form.exec_()
|
||||
okWidget = self.form.button_box.button(self.form.button_box.Save)
|
||||
QtTest.QTest.mouseClick(okWidget, QtCore.Qt.LeftButton)
|
||||
@ -57,7 +57,7 @@ class TestStartNoteDialog(TestCase):
|
||||
|
||||
# WHEN displaying the UI, having set the text and pressing enter
|
||||
self.form.text_edit.setPlainText(u'')
|
||||
with patch(u'PyQt4.QtGui.QDialog') as mocked_exec:
|
||||
with patch(u'PyQt4.QtGui.QDialog.exec_'):
|
||||
self.form.exec_()
|
||||
self.form.text_edit.setPlainText(text)
|
||||
okWidget = self.form.button_box.button(self.form.button_box.Save)
|
||||
|
@ -14,7 +14,7 @@ class TestStartTimeDialog(TestCase):
|
||||
"""
|
||||
Create the UI
|
||||
"""
|
||||
registry = Registry.create()
|
||||
Registry.create()
|
||||
self.app = QtGui.QApplication([])
|
||||
self.main_window = QtGui.QMainWindow()
|
||||
Registry().register(u'main_window', self.main_window)
|
||||
@ -67,7 +67,7 @@ class TestStartTimeDialog(TestCase):
|
||||
|
||||
# WHEN displaying the UI and pressing enter
|
||||
self.form.item = {u'service_item': mocked_serviceitem}
|
||||
with patch(u'PyQt4.QtGui.QDialog') as mocked_exec:
|
||||
with patch(u'PyQt4.QtGui.QDialog.exec_'):
|
||||
self.form.exec_()
|
||||
okWidget = self.form.button_box.button(self.form.button_box.Ok)
|
||||
QtTest.QTest.mouseClick(okWidget, QtCore.Qt.LeftButton)
|
||||
@ -80,7 +80,7 @@ class TestStartTimeDialog(TestCase):
|
||||
|
||||
# WHEN displaying the UI, changing the time to 2min 3secs and pressing enter
|
||||
self.form.item = {u'service_item': mocked_serviceitem}
|
||||
with patch(u'PyQt4.QtGui.QDialog') as mocked_exec:
|
||||
with patch(u'PyQt4.QtGui.QDialog.exec_'):
|
||||
self.form.exec_()
|
||||
self.form.minuteSpinBox.setValue(2)
|
||||
self.form.secondSpinBox.setValue(3)
|
||||
|
Loading…
Reference in New Issue
Block a user