test_eliminate.py (682B)
1 import unittest 2 3 import plint.pattern 4 from plint import verse, template 5 6 7 class Eliminate(unittest.TestCase): 8 def testEliminateOneGue(self): 9 text = "gue" 10 v = verse.Verse(text, template.Template(), plint.pattern.Pattern("12")) 11 v.parse() 12 c = ''.join([x.text for x in v.chunks.chunks]) 13 self.assertFalse("gue" in c) 14 15 def testEliminateGue(self): 16 text = "gue gue GUE ogues longuement la guerre" 17 v = verse.Verse(text, template.Template(), plint.pattern.Pattern("12")) 18 v.parse() 19 c = ''.join([x.text for x in v.chunks.chunks]) 20 self.assertFalse("gue" in c) 21 22 if __name__ == "__main__": 23 unittest.main()