示例#1
0
文件: test.py 项目: djplt/mustat
 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")
示例#2
0
文件: test.py 项目: djplt/mustat
 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"])
示例#3
0
文件: test.py 项目: djplt/mustat
 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"])
示例#4
0
文件: test.py 项目: djplt/mustat
 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"])
示例#5
0
文件: test.py 项目: djplt/mustat
 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"])