mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2024-11-26 00:56:22 +01:00
add unitest for getWebhookInfo
This commit is contained in:
parent
01a5a1c5b3
commit
bfb4c63d60
1 changed files with 9 additions and 0 deletions
|
@ -255,6 +255,15 @@ class BotTest(BaseTest, unittest.TestCase):
|
|||
self.assertEqual(chat_member.status, "administrator")
|
||||
self._testUserEqualsBot(bot)
|
||||
|
||||
@flaky(3, 1)
|
||||
@timeout(10)
|
||||
def test_get_webhook_info(self):
|
||||
url = 'https://python-telegram-bot.org/test/webhook'
|
||||
self._bot.set_webhook(url)
|
||||
info = self._bot.getWebhookInfo()
|
||||
self._bot.set_webhook('')
|
||||
self.assertEqual(url, info.url)
|
||||
|
||||
def _testUserEqualsBot(self, user):
|
||||
"""Tests if user is our trusty @PythonTelegramBot."""
|
||||
self.assertEqual(user.id, 133505823)
|
||||
|
|
Loading…
Reference in a new issue