~alisonken1/openlp/pjlink2-f

« back to all changes in this revision

Viewing changes to tests/functional/openlp_plugins/songs/test_videopsalm.py

  • Committer: Tim Bentley
  • Author(s): Tomas Groth
  • Date: 2017-05-17 20:30:47 UTC
  • mfrom: (2587.3.78 chords)
  • Revision ID: tim.bentley@gmail.com-20170517203047-o11dl9bfu3re2tu0
Added support for chords in Chord Pro format (using brackets), with support for chord transposing and 3 different notations.
Added support for import of song in ChordPro file format
Added support for importing chords and verseorder from songbeamer.
Add support for export and import of chords in openlyrics
Added support for importing chords from opensong.
Added support for importing chords from videopsalm.
Added support for printing chords.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
import os
26
26
 
27
27
from tests.helpers.songfileimport import SongImportTestHelper
 
28
from unittest.mock import patch, MagicMock
28
29
 
29
30
TEST_PATH = os.path.abspath(
30
31
    os.path.join(os.path.dirname(__file__), '..', '..', '..', 'resources', 'videopsalmsongs'))
37
38
        self.importer_module_name = 'videopsalm'
38
39
        super(TestVideoPsalmFileImport, self).__init__(*args, **kwargs)
39
40
 
40
 
    def test_song_import(self):
 
41
    @patch('openlp.plugins.songs.lib.importers.videopsalm.Settings')
 
42
    def test_song_import(self, mocked_settings):
41
43
        """
42
44
        Test that loading an VideoPsalm file works correctly on various files
43
45
        """
 
46
        # Mock out the settings - always return False
 
47
        mocked_returned_settings = MagicMock()
 
48
        mocked_returned_settings.value.side_effect = lambda value: True if value == 'songs/enable chords' else False
 
49
        mocked_settings.return_value = mocked_returned_settings
 
50
        # Do the test import
44
51
        self.file_import(os.path.join(TEST_PATH, 'videopsalm-as-safe-a-stronghold.json'),
45
52
                         self.load_external_result_data(os.path.join(TEST_PATH, 'as-safe-a-stronghold.json')))
46
53
        self.file_import(os.path.join(TEST_PATH, 'videopsalm-as-safe-a-stronghold2.json'),