forked from openlp/openlp
fixed tests
This commit is contained in:
parent
394e5a5be2
commit
11fe2045e5
@ -48,7 +48,8 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
class SongIterator(object):
|
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):
|
def __init__(self, songs):
|
||||||
self.songs = songs
|
self.songs = songs
|
||||||
|
@ -96,10 +96,10 @@ class TestLib(TestCase):
|
|||||||
self.song2.search_lyrics = self.full_lyrics
|
self.song2.search_lyrics = self.full_lyrics
|
||||||
|
|
||||||
# WHEN: We compare those songs for equality.
|
# 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.
|
# 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):
|
def songs_probably_equal_short_song_test(self):
|
||||||
"""
|
"""
|
||||||
@ -110,10 +110,10 @@ class TestLib(TestCase):
|
|||||||
self.song2.search_lyrics = self.short_lyrics
|
self.song2.search_lyrics = self.short_lyrics
|
||||||
|
|
||||||
# WHEN: We compare those songs for equality.
|
# 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.
|
# 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):
|
def songs_probably_equal_error_song_test(self):
|
||||||
"""
|
"""
|
||||||
@ -124,10 +124,10 @@ class TestLib(TestCase):
|
|||||||
self.song2.search_lyrics = self.error_lyrics
|
self.song2.search_lyrics = self.error_lyrics
|
||||||
|
|
||||||
# WHEN: We compare those songs for equality.
|
# 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.
|
# 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):
|
def songs_probably_equal_different_song_test(self):
|
||||||
"""
|
"""
|
||||||
@ -138,10 +138,10 @@ class TestLib(TestCase):
|
|||||||
self.song2.search_lyrics = self.different_lyrics
|
self.song2.search_lyrics = self.different_lyrics
|
||||||
|
|
||||||
# WHEN: We compare those songs for equality.
|
# 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.
|
# 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):
|
def remove_typos_beginning_test(self):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user