def _doTest(self, text, table): N = Normalizer( table ) got = N.normalize(text) expected = text for old,new in table: expected = expected.replace(old, new) self.assertEqual(got, expected)
def testSimple(self): N = Normalizer( [] ) self.assertEqual(N.getTable(), [] ) N = Normalizer( [('a','b'),('c','d'), ('a','b') ] ) self.assertEqual(N.getTable(), [('a','b'),('c','d'), ('a','b') ] )