MCPcopy
hub / github.com/aosabook/500lines / test_timeout

Method test_timeout

cluster/code/test/test_network.py:32–39  ·  view source on GitHub ↗

Node's timeouts trigger at the appropriate time

(self)

Source from the content-addressed store, hash-verified

30 self.failUnless(comp.join_called)
31
32 def test_timeout(self):
33 """Node's timeouts trigger at the appropriate time"""
34 node = self.network.new_node('T')
35
36 cb = mock.Mock(side_effect=lambda: self.kill(node))
37 self.network.set_timer(node.address, 0.01, cb)
38 self.network.run()
39 self.failUnless(cb.called)
40
41 def test_cancel_timeout(self):
42 """Node's timeouts do not occur if they are cancelled."""

Callers

nothing calls this directly

Calls 4

killMethod · 0.95
new_nodeMethod · 0.45
set_timerMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected