summaryrefslogtreecommitdiff
path: root/t/unit/asynchronous/test_hub.py
diff options
context:
space:
mode:
Diffstat (limited to 't/unit/asynchronous/test_hub.py')
-rw-r--r--t/unit/asynchronous/test_hub.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/t/unit/asynchronous/test_hub.py b/t/unit/asynchronous/test_hub.py
index bcbbb260..27b048b9 100644
--- a/t/unit/asynchronous/test_hub.py
+++ b/t/unit/asynchronous/test_hub.py
@@ -1,7 +1,7 @@
from __future__ import annotations
import errno
-from unittest.mock import Mock, call, patch
+from unittest.mock import ANY, Mock, call, patch
import pytest
from vine import promise
@@ -542,6 +542,23 @@ class test_Hub:
callbacks[1].assert_called_once_with()
deferred.assert_not_called()
+ def test_loop__no_todo_tick_delay(self):
+ cb = Mock(name='parent')
+ cb.todo, cb.tick, cb.poller = Mock(), Mock(), Mock()
+ cb.poller.poll.side_effect = lambda obj: ()
+ self.hub.poller = cb.poller
+ self.hub.add(2, Mock(), READ)
+ self.hub.call_soon(cb.todo)
+ self.hub.on_tick = [cb.tick]
+
+ next(self.hub.loop)
+
+ cb.assert_has_calls([
+ call.todo(),
+ call.tick(),
+ call.poller.poll(ANY),
+ ])
+
def test__pop_ready_pops_ready_items(self):
self.hub._ready.add(None)
ret = self.hub._pop_ready()