def assert_typo(self, expect, input): try: self.assertEqual(expect, typo(input)) except Exception, e: print "----" print "'%s'" % expect.encode('utf-8') print "'%s'" % typo(input).encode('utf-8') raise e
def test__test1(self): all = passed = 0 for input, output in map(lambda x, y : (x, y), \ self.test1_inputs, self.test1_outputs): all += 1 output = output.replace(u'<nowrap>', sym['lnowrap']).replace(u'</nowrap>', sym['rnowrap']) if typo(input) == output: passed += 1 else: print "----" print "'%s'" % output.encode('utf-8') print "'%s'" % typo(input).encode('utf-8') self.assertEqual(all, passed)