From a1294858051e14edd3b28bc54cf038d9c0ecbbfe Mon Sep 17 00:00:00 2001 From: John Kirkland Date: Wed, 9 Oct 2019 08:27:28 +0000 Subject: [PATCH] Resolved issue #282 by deleting the get_books function in HTTPBible, allowing it to use the on in the parent class, BibleImport. --- openlp/plugins/bibles/lib/importers/http.py | 9 +-------- .../openlp_plugins/bibles/test_lib_parse_reference.py | 11 +++++++++++ .../media/forms/test_mediaclipselectorform.py | 3 +++ 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/openlp/plugins/bibles/lib/importers/http.py b/openlp/plugins/bibles/lib/importers/http.py index f15ddbdf9..6a5e4c20c 100644 --- a/openlp/plugins/bibles/lib/importers/http.py +++ b/openlp/plugins/bibles/lib/importers/http.py @@ -37,7 +37,7 @@ from openlp.core.common.registry import Registry from openlp.core.lib.ui import critical_error_message_box from openlp.plugins.bibles.lib import SearchResults from openlp.plugins.bibles.lib.bibleimport import BibleImport -from openlp.plugins.bibles.lib.db import BibleDB, BiblesResourcesDB, Book +from openlp.plugins.bibles.lib.db import BibleDB, BiblesResourcesDB CLEANER_REGEX = re.compile(r' |
|\'\+\'') @@ -709,13 +709,6 @@ class HTTPBible(BibleImport, RegistryProperties): handler = BSExtract() return handler.get_bible_chapter(self.download_name, book, chapter) - def get_books(self): - """ - Return the list of books. - """ - log.debug('HTTPBible.get_books("{name}")'.format(name=Book.name)) - return self.get_all_objects(Book, order_by_ref=Book.id) - def get_chapter_count(self, book): """ Return the number of chapters in a particular book. diff --git a/tests/interfaces/openlp_plugins/bibles/test_lib_parse_reference.py b/tests/interfaces/openlp_plugins/bibles/test_lib_parse_reference.py index 717e66868..ba85c6f90 100644 --- a/tests/interfaces/openlp_plugins/bibles/test_lib_parse_reference.py +++ b/tests/interfaces/openlp_plugins/bibles/test_lib_parse_reference.py @@ -121,3 +121,14 @@ class TestBibleManager(TestCase, TestMixin): results = parse_reference('1 Timothy 1:3-end', self.manager.db_cache['tests'], MagicMock(), 54) # THEN a verse array should be returned assert [(54, 1, 3, -1)] == results, "The bible verses should matches the expected results" + + def test_parse_reference_six(self): + """ + Test the parse_reference method with 1 Timothy 1:3-end without a bible ref id to match + how the GUI does the search. This is logged in issue #282 + """ + # GIVEN given a bible in the bible manager + # WHEN asking to parse the bible reference in Language 0 (english) + results = parse_reference('1 Timothy 1:3-end', self.manager.db_cache['tests'], 0) + # THEN a verse array should be returned + assert [(54, 1, 3, -1)] == results, "The bible verses should matches the expected results" diff --git a/tests/interfaces/openlp_plugins/media/forms/test_mediaclipselectorform.py b/tests/interfaces/openlp_plugins/media/forms/test_mediaclipselectorform.py index 4b93f8e44..d270c25af 100644 --- a/tests/interfaces/openlp_plugins/media/forms/test_mediaclipselectorform.py +++ b/tests/interfaces/openlp_plugins/media/forms/test_mediaclipselectorform.py @@ -53,6 +53,8 @@ class TestMediaClipSelectorForm(TestCase, TestMixin): # Mock VLC so we don't actually use it self.vlc_patcher = patch('openlp.plugins.media.forms.mediaclipselectorform.get_vlc') self.vlc_patcher.start() + self.timer_patcher = patch('openlp.plugins.media.forms.mediaclipselectorform.QtCore.QTimer') + self.timer_patcher.start() Registry().register('application', self.app) # Mock the media item self.mock_media_item = MagicMock() @@ -71,6 +73,7 @@ class TestMediaClipSelectorForm(TestCase, TestMixin): """ del self.form self.vlc_patcher.stop() + self.timer_patcher.stop() del self.main_window def test_basic(self):