mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2025-02-17 02:34:18 +01:00
fix tests
This commit is contained in:
parent
cd38bdbed5
commit
86c8ebbfb7
2 changed files with 17 additions and 2 deletions
|
@ -85,6 +85,7 @@ class BotTest(BaseTest, unittest.TestCase):
|
|||
@flaky(3, 1)
|
||||
@timeout(10)
|
||||
def testGetUpdates(self):
|
||||
self._bot.delete_webhook() # make sure there is no webhook set if webhook tests failed
|
||||
updates = self._bot.getUpdates(timeout=1)
|
||||
|
||||
if updates:
|
||||
|
|
|
@ -801,7 +801,7 @@ class MockBot(object):
|
|||
|
||||
return update
|
||||
|
||||
def setWebhook(self, webhook_url=None, certificate=None):
|
||||
def setWebhook(self, url=None, certificate=None):
|
||||
if self.bootstrap_retries is None:
|
||||
return
|
||||
|
||||
|
@ -809,7 +809,21 @@ class MockBot(object):
|
|||
self.bootstrap_attempts += 1
|
||||
raise self.bootstrap_err
|
||||
|
||||
def getUpdates(self, offset=None, limit=100, timeout=0, network_delay=None, read_latency=2.):
|
||||
def deleteWebhook(self):
|
||||
if self.bootstrap_retries is None:
|
||||
return
|
||||
|
||||
if self.bootstrap_attempts < self.bootstrap_retries:
|
||||
self.bootstrap_attempts += 1
|
||||
raise self.bootstrap_err
|
||||
|
||||
def getUpdates(self,
|
||||
offset=None,
|
||||
limit=100,
|
||||
timeout=0,
|
||||
network_delay=None,
|
||||
read_latency=2.,
|
||||
allowed_updates=None):
|
||||
|
||||
if self.raise_error:
|
||||
raise TelegramError('Test Error 2')
|
||||
|
|
Loading…
Add table
Reference in a new issue