From 4c53cb5184a4cd24195ce54b5b15a010460e6639 Mon Sep 17 00:00:00 2001 From: Tomas Groth <second@tgc.dk> Date: Thu, 29 Jan 2015 20:54:06 +0000 Subject: [PATCH] Added tests --- .../songs/test_presentationmanagerimport.py | 10 +++--- .../bibles/test_lib_parse_reference.py | 10 ++++++ .../Amazing Grace.json | 29 ++++++++++++++++++ .../Amazing Grace.sng | Bin 0 -> 2206 bytes 4 files changed, 45 insertions(+), 4 deletions(-) create mode 100644 tests/resources/presentationmanagersongs/Amazing Grace.json create mode 100644 tests/resources/presentationmanagersongs/Amazing Grace.sng diff --git a/tests/functional/openlp_plugins/songs/test_presentationmanagerimport.py b/tests/functional/openlp_plugins/songs/test_presentationmanagerimport.py index 218596cf7..c351f7ed3 100644 --- a/tests/functional/openlp_plugins/songs/test_presentationmanagerimport.py +++ b/tests/functional/openlp_plugins/songs/test_presentationmanagerimport.py @@ -42,7 +42,9 @@ class TestPresentationManagerFileImport(SongImportTestHelper): """ Test that loading a PresentationManager file works correctly """ - self.file_import([os.path.join(TEST_PATH, 'Great Is Thy Faithfulness.sng')], - self.load_external_result_data(os.path.join(TEST_PATH, 'Great Is Thy Faithfulness.json'))) - self.file_import([os.path.join(TEST_PATH, 'Agnus Dei.sng')], - self.load_external_result_data(os.path.join(TEST_PATH, 'Agnus Dei.json'))) + #self.file_import([os.path.join(TEST_PATH, 'Great Is Thy Faithfulness.sng')], + # self.load_external_result_data(os.path.join(TEST_PATH, 'Great Is Thy Faithfulness.json'))) + #self.file_import([os.path.join(TEST_PATH, 'Agnus Dei.sng')], + # self.load_external_result_data(os.path.join(TEST_PATH, 'Agnus Dei.json'))) + self.file_import([os.path.join(TEST_PATH, 'Amazing Grace.sng')], + self.load_external_result_data(os.path.join(TEST_PATH, 'Amazing Grace.json'))) 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 4c0e0fe14..b4eec48af 100644 --- a/tests/interfaces/openlp_plugins/bibles/test_lib_parse_reference.py +++ b/tests/interfaces/openlp_plugins/bibles/test_lib_parse_reference.py @@ -109,3 +109,13 @@ class TestBibleManager(TestCase, TestMixin): results = parse_reference('Raoul 1', self.manager.db_cache['tests'], MagicMock()) # THEN a verse array should be returned self.assertEqual(False, results, "The bible Search should return False") + + def parse_reference_five_test(self): + """ + Test the parse_reference method with 1 Timothy 1:3-end + """ + # GIVEN given a bible in the bible manager + # WHEN asking to parse the bible reference + results = parse_reference('1 Timothy 1:3-end', self.manager.db_cache['tests'], MagicMock(), 54) + # THEN a verse array should be returned + self.assertEqual([(54, 1, 3, -1)], results, "The bible verses should matches the expected results") diff --git a/tests/resources/presentationmanagersongs/Amazing Grace.json b/tests/resources/presentationmanagersongs/Amazing Grace.json new file mode 100644 index 000000000..fa2e182a9 --- /dev/null +++ b/tests/resources/presentationmanagersongs/Amazing Grace.json @@ -0,0 +1,29 @@ +{ + "title": "Amazing Grace", + "authors": [ + "John Newton" + ], + "verse_order_list": ["v1", "v2", "v3", "v4", "v5"], + "verses": [ + [ + "Amazing grace! How sweet the sound!\nThat saved a wretch like me!\nI once was lost, but now am found;\nWas blind, but now I see.", + "v1" + ], + [ + "'Twas grace that taught my heart to fear,\nAnd grace my fears relieved.\nHow precious did that grace appear,\nThe hour I first believed.", + "v2" + ], + [ + "The Lord has promised good to me,\nHis Word my hope secures.\nHe will my shield and portion be\nAs long as life endures.", + "v3" + ], + [ + "Thro' many dangers, toils and snares\nI have already come.\n'Tis grace that brought me safe thus far,\nAnd grace will lead me home.", + "v4" + ], + [ + "When we've been there ten thousand years,\nBright shining as the sun,\nWe've no less days to sing God's praise,\nThan when we first begun.", + "v5" + ] + ] +} diff --git a/tests/resources/presentationmanagersongs/Amazing Grace.sng b/tests/resources/presentationmanagersongs/Amazing Grace.sng new file mode 100644 index 0000000000000000000000000000000000000000..47b5ff3b3a471513105cdef53394950c49f55a72 GIT binary patch literal 2206 zcmbW2OK;Oq5QS%r#D8$R$)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