mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2025-03-30 11:19:24 +02:00
Due kwargs I had to change the factory class in favor of InputLocationMessageContent #302
This commit is contained in:
parent
408959e91c
commit
0b2fd120d8
2 changed files with 5 additions and 8 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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')
|
||||
|
|
Loading…
Add table
Reference in a new issue