From bfb4c63d60923622d52c0dfadefaaa9ea1f7be60 Mon Sep 17 00:00:00 2001 From: Noam Meltzer Date: Thu, 6 Oct 2016 00:11:28 +0300 Subject: [PATCH] add unitest for getWebhookInfo --- tests/test_bot.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/test_bot.py b/tests/test_bot.py index 5efb576ab..ce8d01576 100644 --- a/tests/test_bot.py +++ b/tests/test_bot.py @@ -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)