~alisonken1/openlp/pjlink2-f

« back to all changes in this revision

Viewing changes to tests/functional/openlp_plugins/songs/test_opensongimport.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:
42
42
        self.importer_module_name = 'opensong'
43
43
        super(TestOpenSongFileImport, self).__init__(*args, **kwargs)
44
44
 
45
 
    def test_song_import(self):
 
45
    @patch('openlp.plugins.songs.lib.importers.opensong.Settings')
 
46
    def test_song_import(self, mocked_settings):
46
47
        """
47
48
        Test that loading an OpenSong file works correctly on various files
48
49
        """
 
50
        # Mock out the settings - always return False
 
51
        mocked_returned_settings = MagicMock()
 
52
        mocked_returned_settings.value.side_effect = lambda value: True if value == 'songs/enable chords' else False
 
53
        mocked_settings.return_value = mocked_returned_settings
 
54
        # Do the test import
49
55
        self.file_import([os.path.join(TEST_PATH, 'Amazing Grace')],
50
56
                         self.load_external_result_data(os.path.join(TEST_PATH, 'Amazing Grace.json')))
51
57
        self.file_import([os.path.join(TEST_PATH, 'Beautiful Garden Of Prayer')],