def test_lyric_split_by_whitespace(self): ''' Test case: Test the util function to be able extract relevant words from the the lyrics string. ''' output = lyricFormat("dupa kupa lupa") self.assertListEqual(output, ["dupa", "kupa", "lupa"]) output = lyricFormat("dupa kupa lupa") self.assertListEqual(output, ["dupa", "kupa", "lupa"]) output = lyricFormat("dupa\nkupa\t\n\r\t lupa")
def test_lyric_lower_case(self): ''' Test case: Test the util function to be able to convert to lower case. ''' # Strange input but we should be able to handle it. output = lyricFormat('DUPA KupA') self.assertListEqual(output, ["dupa", "kupa"])
def test_lyric_handle_numbers(self): ''' Test case: Test the util function to be able to handle numbers. ''' # Strange input but we should be able to handle it. output = lyricFormat('26th,27th') self.assertListEqual(output, ["26th", "27th"])
def test_lyric_ignore_punctuation(self): ''' Test case: Test the util function to be able to ignore punctuation. ''' # Strange input but we should be able to handle it. output = lyricFormat('dupa!!kupa ?, - lupa"mupa') self.assertListEqual(output, ["dupa", "kupa", "lupa", "mupa"])
def test_lyric_format_apostrophe(self): ''' Test case: Test the util function to be able to sanitise apostrophes ''' # Strange input but we should be able to handle it. output = lyricFormat("don't don`t don´t") self.assertListEqual(output, ["don't", "don't", "don't"])