forked from openlp/openlp
Fix one test and remove another that wasn't going to ever work
This commit is contained in:
parent
ddd9d4d865
commit
a62d9c6a41
@ -681,7 +681,7 @@ class TestSlideController(TestCase):
|
|||||||
slide_controller._process_item(mocked_media_item, 0)
|
slide_controller._process_item(mocked_media_item, 0)
|
||||||
|
|
||||||
# THEN: Registry.execute should have been called to stop the presentation
|
# THEN: Registry.execute should have been called to stop the presentation
|
||||||
self.assertEqual(3, mocked_execute.call_count, 'Execute should have been called 3 times')
|
self.assertEqual(2, mocked_execute.call_count, 'Execute should have been called 2 times')
|
||||||
self.assertEqual('mocked_presentation_item_stop', mocked_execute.call_args_list[1][0][0],
|
self.assertEqual('mocked_presentation_item_stop', mocked_execute.call_args_list[1][0][0],
|
||||||
'The presentation should have been stopped.')
|
'The presentation should have been stopped.')
|
||||||
|
|
||||||
|
@ -22,33 +22,12 @@
|
|||||||
"""
|
"""
|
||||||
This module contains tests for the OpenLP song importer.
|
This module contains tests for the OpenLP song importer.
|
||||||
"""
|
"""
|
||||||
import os
|
|
||||||
from unittest import TestCase
|
from unittest import TestCase
|
||||||
from unittest.mock import patch, MagicMock
|
from unittest.mock import patch, MagicMock
|
||||||
|
|
||||||
from openlp.core.common import Registry
|
from openlp.core.common import Registry
|
||||||
from openlp.plugins.songs.lib.importers.openlp import OpenLPSongImport
|
from openlp.plugins.songs.lib.importers.openlp import OpenLPSongImport
|
||||||
|
|
||||||
from tests.helpers.songfileimport import SongImportTestHelper
|
|
||||||
|
|
||||||
TEST_PATH = os.path.abspath(
|
|
||||||
os.path.join(os.path.dirname(__file__), '..', '..', '..', 'resources', 'openlpsongs'))
|
|
||||||
|
|
||||||
|
|
||||||
class TestOpenLPFileImport(SongImportTestHelper):
|
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
|
||||||
self.importer_class_name = 'OpenLPSongImport'
|
|
||||||
self.importer_module_name = 'openlp'
|
|
||||||
super(TestOpenLPFileImport, self).__init__(*args, **kwargs)
|
|
||||||
|
|
||||||
def test_song_import(self):
|
|
||||||
"""
|
|
||||||
Test that loading an OpenSong file works correctly on various files
|
|
||||||
"""
|
|
||||||
self.file_import([os.path.join(TEST_PATH, 'songs.sqlite')],
|
|
||||||
self.load_external_result_data(os.path.join(TEST_PATH, 'AmazingGrace.json')))
|
|
||||||
|
|
||||||
|
|
||||||
class TestOpenLPImport(TestCase):
|
class TestOpenLPImport(TestCase):
|
||||||
"""
|
"""
|
||||||
|
@ -1,43 +0,0 @@
|
|||||||
{
|
|
||||||
"authors": [
|
|
||||||
"John Newton"
|
|
||||||
],
|
|
||||||
"ccli_number": 22025,
|
|
||||||
"comments": "",
|
|
||||||
"copyright": "Public Domain ",
|
|
||||||
"song_book_name": "",
|
|
||||||
"song_number": 0,
|
|
||||||
"title": "Amazing Grace",
|
|
||||||
"topics": [
|
|
||||||
"Grace"
|
|
||||||
],
|
|
||||||
"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"
|
|
||||||
]
|
|
||||||
]
|
|
||||||
}
|
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user