MCPcopy Create free account
hub / github.com/EasyIME/PIME / test_notify_n

Method test_notify_n

python/python3/tornado/test/locks_test.py:75–90  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

73 self.assertEqual(["wait1", "notify1", "wait2", "notify2"], self.history)
74
75 def test_notify_n(self):
76 c = locks.Condition()
77 for i in range(6):
78 self.record_done(c.wait(), i)
79
80 c.notify(3)
81 self.loop_briefly()
82
83 # Callbacks execute in the order they were registered.
84 self.assertEqual(list(range(3)), self.history)
85 c.notify(1)
86 self.loop_briefly()
87 self.assertEqual(list(range(4)), self.history)
88 c.notify(2)
89 self.loop_briefly()
90 self.assertEqual(list(range(6)), self.history)
91
92 def test_notify_all(self):
93 c = locks.Condition()

Callers

nothing calls this directly

Calls 5

record_doneMethod · 0.95
waitMethod · 0.95
notifyMethod · 0.95
loop_brieflyMethod · 0.95
listFunction · 0.85

Tested by

no test coverage detected