X Tutup
Skip to content

Commit bfb4c63

Browse files
committed
add unitest for getWebhookInfo
1 parent 01a5a1c commit bfb4c63

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/test_bot.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,15 @@ def testGetChatMember(self):
255255
self.assertEqual(chat_member.status, "administrator")
256256
self._testUserEqualsBot(bot)
257257

258+
@flaky(3, 1)
259+
@timeout(10)
260+
def test_get_webhook_info(self):
261+
url = 'https://python-telegram-bot.org/test/webhook'
262+
self._bot.set_webhook(url)
263+
info = self._bot.getWebhookInfo()
264+
self._bot.set_webhook('')
265+
self.assertEqual(url, info.url)
266+
258267
def _testUserEqualsBot(self, user):
259268
"""Tests if user is our trusty @PythonTelegramBot."""
260269
self.assertEqual(user.id, 133505823)

0 commit comments

Comments
 (0)
X Tutup