diff --git a/openlp/plugins/songs/forms/duplicatesongremovalform.py b/openlp/plugins/songs/forms/duplicatesongremovalform.py index 54778de03..d63391c08 100644 --- a/openlp/plugins/songs/forms/duplicatesongremovalform.py +++ b/openlp/plugins/songs/forms/duplicatesongremovalform.py @@ -48,7 +48,8 @@ log = logging.getLogger(__name__) class SongIterator(object): """ - This class implements an iterator for the song duplicate finder. The iterator returns a tuple of two songs. + This class implements an iterator for the song duplicate finder. The iterator returns a tuple of two songs. When + completely iterated then all songs have once been returned combined with any other songs. """ def __init__(self, songs): self.songs = songs diff --git a/tests/functional/openlp_plugins/songs/test_lib.py b/tests/functional/openlp_plugins/songs/test_lib.py index beff6d0d5..2683770c6 100644 --- a/tests/functional/openlp_plugins/songs/test_lib.py +++ b/tests/functional/openlp_plugins/songs/test_lib.py @@ -96,10 +96,10 @@ class TestLib(TestCase): self.song2.search_lyrics = self.full_lyrics # WHEN: We compare those songs for equality. - result = songs_probably_equal(self.song1, self.song2) + result = songs_probably_equal((self.song1, self.song2)) # THEN: The result should be True. - assert result == True, 'The result should be True' + assert result == (self.song1, self.song2), 'The result should be the tuble of songs' def songs_probably_equal_short_song_test(self): """ @@ -110,10 +110,10 @@ class TestLib(TestCase): self.song2.search_lyrics = self.short_lyrics # WHEN: We compare those songs for equality. - result = songs_probably_equal(self.song1, self.song2) + result = songs_probably_equal((self.song1, self.song2)) # THEN: The result should be True. - assert result == True, 'The result should be True' + assert result == (self.song1, self.song2), 'The result should be the tuble of songs' def songs_probably_equal_error_song_test(self): """ @@ -124,10 +124,10 @@ class TestLib(TestCase): self.song2.search_lyrics = self.error_lyrics # WHEN: We compare those songs for equality. - result = songs_probably_equal(self.song1, self.song2) + result = songs_probably_equal((self.song1, self.song2)) # THEN: The result should be True. - assert result == True, 'The result should be True' + assert result == (self.song1, self.song2), 'The result should be the tuble of songs' def songs_probably_equal_different_song_test(self): """ @@ -138,10 +138,10 @@ class TestLib(TestCase): self.song2.search_lyrics = self.different_lyrics # WHEN: We compare those songs for equality. - result = songs_probably_equal(self.song1, self.song2) + result = songs_probably_equal((self.song1, self.song2)) # THEN: The result should be False. - assert result == False, 'The result should be False' + assert result is None, 'The result should be None' def remove_typos_beginning_test(self): """