Fix tests for Py2.6

This commit is contained in:
Leandro Toledo 2015-08-28 13:07:12 -03:00
parent 6132e65dc3
commit 6837bef9bb

View file

@ -58,7 +58,7 @@ class BotTest(unittest.TestCase):
text='Моё судно на воздушной подушке полно угрей') text='Моё судно на воздушной подушке полно угрей')
self.assertTrue(self.is_json(message.to_json())) self.assertTrue(self.is_json(message.to_json()))
self.assertEqual(u'Моё судно на воздушной подушке полно угрей', message.text) self.assertEqual(u'Моё судно на воздушной подушке полно угрей', message.text)
self.assertIsInstance(message.date, datetime) self.assertTrue(isinstance(message.date, datetime))
def testGetUpdates(self): def testGetUpdates(self):
'''Test the telegram.Bot getUpdates method''' '''Test the telegram.Bot getUpdates method'''
@ -66,7 +66,7 @@ class BotTest(unittest.TestCase):
updates = self._bot.getUpdates() updates = self._bot.getUpdates()
if updates: if updates:
self.assertTrue(self.is_json(updates[0].to_json())) self.assertTrue(self.is_json(updates[0].to_json()))
self.assertIsInstance(updates[0], telegram.Update) self.assertTrue(isinstance(updates[0], telegram.Update))
def testForwardMessage(self): def testForwardMessage(self):
'''Test the telegram.Bot forwardMessage method''' '''Test the telegram.Bot forwardMessage method'''
@ -77,7 +77,7 @@ class BotTest(unittest.TestCase):
self.assertTrue(self.is_json(message.to_json())) self.assertTrue(self.is_json(message.to_json()))
self.assertEqual('Oi', message.text) self.assertEqual('Oi', message.text)
self.assertEqual('leandrotoledo', message.forward_from.username) self.assertEqual('leandrotoledo', message.forward_from.username)
self.assertIsInstance(message.forward_date, datetime) self.assertTrue(isinstance(message.forward_date, datetime))
def testSendPhoto(self): def testSendPhoto(self):
'''Test the telegram.Bot sendPhoto method''' '''Test the telegram.Bot sendPhoto method'''