mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2025-03-16 12:25:45 +01:00
add test for context parameter
This commit is contained in:
parent
41daccce07
commit
20067ff178
1 changed files with 8 additions and 0 deletions
|
@ -69,11 +69,19 @@ class JobQueueTest(BaseTest, unittest.TestCase):
|
|||
self.result += 1
|
||||
job.schedule_removal()
|
||||
|
||||
def job4(self, bot, job):
|
||||
self.result += job.context
|
||||
|
||||
def test_basic(self):
|
||||
self.jq.put(Job(self.job1, 0.1))
|
||||
sleep(1.5)
|
||||
self.assertGreaterEqual(self.result, 10)
|
||||
|
||||
def test_job_with_context(self):
|
||||
self.jq.put(Job(self.job4, 0.1, context=5))
|
||||
sleep(1.5)
|
||||
self.assertGreaterEqual(self.result, 50)
|
||||
|
||||
def test_noRepeat(self):
|
||||
self.jq.put(Job(self.job1, 0.1, repeat=False))
|
||||
sleep(0.5)
|
||||
|
|
Loading…
Add table
Reference in a new issue