From 5d0710ac3a8e6f6ddf628b1ad1d53bfa219decdc Mon Sep 17 00:00:00 2001 From: ikkemaniac Date: Sun, 21 Jun 2020 20:17:38 +0200 Subject: [PATCH] replicate original get_updates() --- tests/test_updater.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/test_updater.py b/tests/test_updater.py index 0c463e626..e49823c15 100644 --- a/tests/test_updater.py +++ b/tests/test_updater.py @@ -75,7 +75,7 @@ class TestUpdater: attempts = 0 err_handler_called = Event() cb_handler_called = Event() - offset = 0 + updates = [] @pytest.fixture(autouse=True) def reset(self): @@ -110,7 +110,7 @@ class TestUpdater: # we should be called with offset = 4 # save value passed in self.offset for assert down below if len(args) > 0: - return [FakeUpdate(i) for i in range(args[0], expected_id)] + return [self.updates[i] for i in range(args[0], expected_id)] # case 1 # return list of obj's @@ -119,7 +119,8 @@ class TestUpdater: # returns list of 3 objects with # update_id's 1, 2 and 3 print ('bla') - return [FakeUpdate(i) for i in range(1, expected_id)] + self.updates = [FakeUpdate(i) for i in range(1, expected_id)] + return self.updates monkeypatch.setattr(updater.bot, 'get_updates', get_updates)