openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #31478
[Merge] lp:~phill-ridout/openlp/test_fixes into lp:openlp
Phill has proposed merging lp:~phill-ridout/openlp/test_fixes into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
For more details, see:
https://code.launchpad.net/~phill-ridout/openlp/test_fixes/+merge/323709
Fix the QFormLayout in BibleImportForm
Fix one of the tests that was skipped
lp:~phill-ridout/openlp/test_fixes (revision 2732)
[SUCCESS] https://ci.openlp.io/job/Branch-01-Pull/1973/
[SUCCESS] https://ci.openlp.io/job/Branch-02-Functional-Tests/1883/
[SUCCESS] https://ci.openlp.io/job/Branch-03-Interface-Tests/1824/
[SUCCESS] https://ci.openlp.io/job/Branch-04a-Code_Analysis/1206/
[SUCCESS] https://ci.openlp.io/job/Branch-04b-Test_Coverage/1074/
[SUCCESS] https://ci.openlp.io/job/Branch-04c-Code_Analysis2/203/
[FAILURE] https://ci.openlp.io/job/Branch-05-AppVeyor-Tests/52/
Stopping after failure
--
Your team OpenLP Core is requested to review the proposed merge of lp:~phill-ridout/openlp/test_fixes into lp:openlp.
=== modified file 'openlp/plugins/bibles/forms/bibleimportform.py'
--- openlp/plugins/bibles/forms/bibleimportform.py 2017-01-08 19:12:12 +0000
+++ openlp/plugins/bibles/forms/bibleimportform.py 2017-05-06 09:39:55 +0000
@@ -135,6 +135,7 @@
Add the bible import specific wizard pages.
"""
# Select Page
+ self.spacers = []
self.select_page = QtWidgets.QWizardPage()
self.select_page.setObjectName('SelectPage')
self.select_page_layout = QtWidgets.QVBoxLayout(self.select_page)
@@ -147,8 +148,8 @@
self.format_combo_box.addItems(['', '', '', '', '', '', ''])
self.format_combo_box.setObjectName('FormatComboBox')
self.format_layout.addRow(self.format_label, self.format_combo_box)
- self.spacer = QtWidgets.QSpacerItem(10, 0, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Minimum)
- self.format_layout.setItem(1, QtWidgets.QFormLayout.LabelRole, self.spacer)
+ self.spacers.append(QtWidgets.QSpacerItem(10, 0, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Minimum))
+ self.format_layout.setItem(1, QtWidgets.QFormLayout.LabelRole, self.spacers[-1])
self.select_page_layout.addLayout(self.format_layout)
self.select_stack = QtWidgets.QStackedLayout()
self.select_stack.setObjectName('SelectStack')
@@ -170,7 +171,8 @@
self.osis_browse_button.setObjectName('OsisBrowseButton')
self.osis_file_layout.addWidget(self.osis_browse_button)
self.osis_layout.addRow(self.osis_file_label, self.osis_file_layout)
- self.osis_layout.setItem(1, QtWidgets.QFormLayout.LabelRole, self.spacer)
+ self.spacers.append(QtWidgets.QSpacerItem(10, 0, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Minimum))
+ self.osis_layout.setItem(1, QtWidgets.QFormLayout.LabelRole, self.spacers[-1])
self.select_stack.addWidget(self.osis_widget)
self.csv_widget = QtWidgets.QWidget(self.select_page)
self.csv_widget.setObjectName('CsvWidget')
@@ -203,7 +205,8 @@
self.csv_verses_button.setObjectName('CsvVersesButton')
self.csv_verses_layout.addWidget(self.csv_verses_button)
self.csv_layout.addRow(self.csv_verses_label, self.csv_verses_layout)
- self.csv_layout.setItem(3, QtWidgets.QFormLayout.LabelRole, self.spacer)
+ self.spacers.append(QtWidgets.QSpacerItem(10, 0, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Minimum))
+ self.csv_layout.setItem(2, QtWidgets.QFormLayout.LabelRole, self.spacers[-1])
self.select_stack.addWidget(self.csv_widget)
self.open_song_widget = QtWidgets.QWidget(self.select_page)
self.open_song_widget.setObjectName('OpenSongWidget')
@@ -223,7 +226,8 @@
self.open_song_browse_button.setObjectName('OpenSongBrowseButton')
self.open_song_file_layout.addWidget(self.open_song_browse_button)
self.open_song_layout.addRow(self.open_song_file_label, self.open_song_file_layout)
- self.open_song_layout.setItem(1, QtWidgets.QFormLayout.LabelRole, self.spacer)
+ self.spacers.append(QtWidgets.QSpacerItem(10, 0, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Minimum))
+ self.open_song_layout.setItem(1, QtWidgets.QFormLayout.LabelRole, self.spacers[-1])
self.select_stack.addWidget(self.open_song_widget)
self.web_tab_widget = QtWidgets.QTabWidget(self.select_page)
self.web_tab_widget.setObjectName('WebTabWidget')
@@ -300,7 +304,8 @@
self.zefania_browse_button.setObjectName('ZefaniaBrowseButton')
self.zefania_file_layout.addWidget(self.zefania_browse_button)
self.zefania_layout.addRow(self.zefania_file_label, self.zefania_file_layout)
- self.zefania_layout.setItem(5, QtWidgets.QFormLayout.LabelRole, self.spacer)
+ self.spacers.append(QtWidgets.QSpacerItem(10, 0, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Minimum))
+ self.zefania_layout.setItem(1, QtWidgets.QFormLayout.LabelRole, self.spacers[-1])
self.select_stack.addWidget(self.zefania_widget)
self.sword_widget = QtWidgets.QWidget(self.select_page)
self.sword_widget.setObjectName('SwordWidget')
@@ -381,7 +386,8 @@
self.wordproject_browse_button.setObjectName('WordProjectBrowseButton')
self.wordproject_file_layout.addWidget(self.wordproject_browse_button)
self.wordproject_layout.addRow(self.wordproject_file_label, self.wordproject_file_layout)
- self.wordproject_layout.setItem(5, QtWidgets.QFormLayout.LabelRole, self.spacer)
+ self.spacers.append(QtWidgets.QSpacerItem(10, 0, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Minimum))
+ self.wordproject_layout.setItem(1, QtWidgets.QFormLayout.LabelRole, self.spacers[-1])
self.select_stack.addWidget(self.wordproject_widget)
self.select_page_layout.addLayout(self.select_stack)
self.addPage(self.select_page)
@@ -499,7 +505,8 @@
self.csv_verses_label.minimumSizeHint().width(),
self.open_song_file_label.minimumSizeHint().width(),
self.zefania_file_label.minimumSizeHint().width())
- self.spacer.changeSize(label_width, 0, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
+ for spacer in self.spacers:
+ spacer.changeSize(label_width, 0, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
def validateCurrentPage(self):
"""
=== modified file 'tests/interfaces/openlp_plugins/bibles/forms/test_bibleimportform.py'
--- tests/interfaces/openlp_plugins/bibles/forms/test_bibleimportform.py 2017-04-25 18:54:18 +0000
+++ tests/interfaces/openlp_plugins/bibles/forms/test_bibleimportform.py 2017-05-06 09:39:55 +0000
@@ -28,12 +28,11 @@
from PyQt5 import QtWidgets
from openlp.core.common import Registry
-from openlp.plugins.bibles.forms.bibleimportform import BibleImportForm, PYSWORD_AVAILABLE
+from openlp.plugins.bibles.forms import bibleimportform
from tests.helpers.testmixin import TestMixin
-@skip('One of the QFormLayouts in the BibleImportForm is causing a segfault')
class TestBibleImportForm(TestCase, TestMixin):
"""
Test the BibleImportForm class
@@ -47,9 +46,9 @@
self.setup_application()
self.main_window = QtWidgets.QMainWindow()
Registry().register('main_window', self.main_window)
- PYSWORD_AVAILABLE = False
+ bibleimportform.PYSWORD_AVAILABLE = False
self.mocked_manager = MagicMock()
- self.form = BibleImportForm(self.main_window, self.mocked_manager, MagicMock())
+ self.form = bibleimportform.BibleImportForm(self.main_window, self.mocked_manager, MagicMock())
def tearDown(self):
"""
Follow ups