Due kwargs I had to change the factory class in favor of InputLocationMessageContent

This commit is contained in:
Leandro Toledo 2016-05-23 21:09:07 -03:00
parent 408959e91c
commit 0b2fd120d8
2 changed files with 5 additions and 8 deletions

View file

@ -39,14 +39,14 @@ class InputMessageContent(TelegramObject):
pass
try:
from telegram import InputLocationMessageContent
return InputLocationMessageContent.de_json(data)
from telegram import InputVenueMessageContent
return InputVenueMessageContent.de_json(data)
except TypeError:
pass
try:
from telegram import InputVenueMessageContent
return InputVenueMessageContent.de_json(data)
from telegram import InputLocationMessageContent
return InputLocationMessageContent.de_json(data)
except TypeError:
pass

View file

@ -75,7 +75,7 @@ class BotTest(BaseTest, unittest.TestCase):
@flaky(3, 1)
@timeout(10)
def testGetUpdates(self):
updates = self._bot.getUpdates()
updates = self._bot.getUpdates(timeout=1)
if updates:
self.assertTrue(self.is_json(updates[0].to_json()))
@ -192,9 +192,6 @@ class BotTest(BaseTest, unittest.TestCase):
def testInvalidToken3(self):
self._test_invalid_token('12:')
def testInvalidToken4(self):
self._test_invalid_token('1234:abcd1234\n')
def testUnauthToken(self):
with self.assertRaisesRegexp(telegram.error.Unauthorized, 'Unauthorized'):
bot = telegram.Bot('1234:abcd1234')