def test_length(self): self.assertEqual(len(main.read_song(r"Lyrics/000~Jerry-Harrison~No-More-Reruns.txt")),369)
def test_lower(self): for i in main.read_song(r"Lyrics/000~Jerry-Harrison~No-More-Reruns.txt"): self.assertEqual(i, i.lower())
def test_type(self): self.assertEqual(type(main.read_song(r"Lyrics/000~Jerry-Harrison~No-More-Reruns.txt")), list)
def test_1(self): self.assertEqual(main.detect_love_count(main.read_song(r"Lyrics/000~Jerry-Harrison~No-More-Reruns.txt")),60)
def test_1(self): self.assertEqual(main.detect_song_mood(main.read_song(r"Lyrics/000~Jerry-Harrison~No-More-Reruns.txt")),0.5073768658321502)
def test_2(self): self.assertEqual(main.detect_profane_count(main.read_song(r"Lyrics/540~The-Exploited~Beat-the-Bastards.txt")),2)
for file in dirs: file_txt_names.append(file) file_txt_names.sort() for file in dirs: file_titles.append(file) for i in range(len(file_titles)): file_titles[i] = file_titles[i].replace(".txt","") song_ID_sorted = main.song_ID_list(file_titles) song_ID_sorted.sort() lyric_dict = {} for n in [0,156,641,541,961,1000]: lyric_dict[song_ID_sorted[n]] = main.read_song(path+'/'+file_txt_names[n]) song_ID_test = ['000','155','540','640','960','999'] #Test read_song main.read_song(r"Lyrics/000~Jerry-Harrison~No-More-Reruns.txt") class TestRead_Song(unittest.TestCase): def test_type(self): self.assertEqual(type(main.read_song(r"Lyrics/000~Jerry-Harrison~No-More-Reruns.txt")), list) def test_length(self): self.assertEqual(len(main.read_song(r"Lyrics/000~Jerry-Harrison~No-More-Reruns.txt")),369)