def test_tr(self): input = Mock(groups=lambda: ('fr', 'en', 'mon chien')) tr(self.phenny, input) out = self.phenny.reply.call_args[0][0] m = re.match("^\"my dog\" \(fr to en, .*\)$", out, flags=re.UNICODE) self.assertTrue(m)
def tr_wrapper(message): translate.tr(message)
def test_tr(self): input = Mock(groups=lambda: ('fr', 'en', 'mon chien')) tr(self.phenny, input) self.assertIn("my dog", self.phenny.reply.call_args[0][0])