From 6b8352abeab476cacdf1c41dd5cc14db74012e95 Mon Sep 17 00:00:00 2001 From: John Lines Date: Tue, 3 Sep 2019 10:52:09 +0100 Subject: [PATCH] fix tests to allow for SongbookNumberInTitle defaulting to false and add hints tests --- .../songs/test_singingthefaithimport.py | 15 +++++++++++++++ tests/resources/songs/singingthefaith/STF001.json | 2 +- tests/resources/songs/singingthefaith/STF002.json | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/tests/functional/openlp_plugins/songs/test_singingthefaithimport.py b/tests/functional/openlp_plugins/songs/test_singingthefaithimport.py index 69e9728c4..671c24865 100644 --- a/tests/functional/openlp_plugins/songs/test_singingthefaithimport.py +++ b/tests/functional/openlp_plugins/songs/test_singingthefaithimport.py @@ -46,3 +46,18 @@ class TestSingingTheFaithFileImport(SongImportTestHelper): # Whole song self.file_import([TEST_PATH / 'H2.txt'], self.load_external_result_data(TEST_PATH / 'STF002.json')) + + # Tests with hints - note that the hints directory has a hints.tag which specifies + # SongbookNumberInTitle: True + # The default is false, so the unhinted tests will not have the title, but the hinted + # song tests will need it + + # Single verse + self.file_import([TEST_PATH / 'hints' / 'H1.txt'], + self.load_external_result_data(TEST_PATH / 'hints' / 'STF001.json')) + # Whole song + self.file_import([TEST_PATH / 'hints' / 'H2.txt'], + self.load_external_result_data(TEST_PATH / 'hints' / 'STF002.json')) + + + diff --git a/tests/resources/songs/singingthefaith/STF001.json b/tests/resources/songs/singingthefaith/STF001.json index edf3ee682..02125d303 100644 --- a/tests/resources/songs/singingthefaith/STF001.json +++ b/tests/resources/songs/singingthefaith/STF001.json @@ -1,5 +1,5 @@ { - "title": "STF001 - Amazing Grace! how sweet the sound!", + "title": "Amazing Grace! how sweet the sound!", "authors": [ "John Newton (d. 1807)" ], diff --git a/tests/resources/songs/singingthefaith/STF002.json b/tests/resources/songs/singingthefaith/STF002.json index 6bfc655bf..f78d23a18 100644 --- a/tests/resources/songs/singingthefaith/STF002.json +++ b/tests/resources/songs/singingthefaith/STF002.json @@ -1,5 +1,5 @@ { - "title": "STF002 - Amazing Grace! how sweet the sound!", + "title": "Amazing Grace! how sweet the sound!", "authors": [ "John Newton (d. 1807)" ],