From 00a0748423ea26a6e3c89bee7a07d4887713570d Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Sun, 10 Feb 2013 22:09:39 +0200 Subject: [PATCH] Try to add the SIP initialisation in a base module. --- tests/interfaces/__init__.py | 8 ++++++++ .../interfaces/openlp_core_ui/test_servicenotedialog.py | 5 +++-- tests/interfaces/openlp_core_ui/test_starttimedialog.py | 1 + .../openlp_plugins_songs_forms/test_authorsform.py | 9 --------- 4 files changed, 12 insertions(+), 11 deletions(-) create mode 100644 tests/interfaces/__init__.py diff --git a/tests/interfaces/__init__.py b/tests/interfaces/__init__.py new file mode 100644 index 000000000..0157fb2f0 --- /dev/null +++ b/tests/interfaces/__init__.py @@ -0,0 +1,8 @@ +import sip +sip.setapi(u'QDate', 2) +sip.setapi(u'QDateTime', 2) +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) diff --git a/tests/interfaces/openlp_core_ui/test_servicenotedialog.py b/tests/interfaces/openlp_core_ui/test_servicenotedialog.py index e444ff687..3b3562de8 100644 --- a/tests/interfaces/openlp_core_ui/test_servicenotedialog.py +++ b/tests/interfaces/openlp_core_ui/test_servicenotedialog.py @@ -1,5 +1,5 @@ """ - Package to test the openlp.core.ui package. +Package to test the openlp.core.ui package. """ from unittest import TestCase @@ -8,6 +8,7 @@ from openlp.core.lib import Registry from openlp.core.ui import servicenoteform from PyQt4 import QtCore, QtGui, QtTest + class TestStartNoteDialog(TestCase): def setUp(self): @@ -64,4 +65,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') \ No newline at end of file + self.assertEqual(self.form.text_edit.toPlainText(), text, u'The new text should be returned') diff --git a/tests/interfaces/openlp_core_ui/test_starttimedialog.py b/tests/interfaces/openlp_core_ui/test_starttimedialog.py index 9d3a29c27..96a71a9c6 100644 --- a/tests/interfaces/openlp_core_ui/test_starttimedialog.py +++ b/tests/interfaces/openlp_core_ui/test_starttimedialog.py @@ -8,6 +8,7 @@ from openlp.core.lib import Registry from openlp.core.ui import starttimeform from PyQt4 import QtCore, QtGui, QtTest + class TestStartTimeDialog(TestCase): def setUp(self): diff --git a/tests/interfaces/openlp_plugins_songs_forms/test_authorsform.py b/tests/interfaces/openlp_plugins_songs_forms/test_authorsform.py index 34a23302d..dc578496d 100644 --- a/tests/interfaces/openlp_plugins_songs_forms/test_authorsform.py +++ b/tests/interfaces/openlp_plugins_songs_forms/test_authorsform.py @@ -1,15 +1,6 @@ """ Package to test the openlp.core.ui package. """ -import sip -sip.setapi(u'QDate', 2) -sip.setapi(u'QDateTime', 2) -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) - from unittest import TestCase from PyQt4 import QtGui