MCPcopy Index your code
hub / github.com/bpython/bpython / test_set_timeout

Method test_set_timeout

bpython/test/test_curtsies.py:64–85  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

62 self.assertEqual(next(cb), None)
63
64 def test_set_timeout(self):
65 eg = EventGenerator("a", zip("bcdefg", [1, 2, 3, 3, 3, 4]))
66 eg.schedule_event(curtsies.events.SigIntEvent(), 5)
67 eg.schedule_event("h", 6)
68 cb = combined_events(eg, paste_threshold=3)
69 self.assertEqual(next(cb), "a")
70 self.assertEqual(cb.send(0), None)
71 self.assertEqual(next(cb), "b")
72 self.assertEqual(cb.send(0), None)
73 eg.tick()
74 self.assertEqual(cb.send(0), "c")
75 self.assertEqual(cb.send(0), None)
76 eg.tick()
77 self.assertIsInstance(cb.send(0), curtsies.events.PasteEvent)
78 self.assertEqual(cb.send(0), None)
79 self.assertEqual(cb.send(None), "g")
80 self.assertEqual(cb.send(0), None)
81 eg.tick(1)
82 self.assertIsInstance(cb.send(0), curtsies.events.SigIntEvent)
83 self.assertEqual(cb.send(0), None)
84 self.assertEqual(cb.send(None), "h")
85 self.assertEqual(cb.send(None), None)
86
87
88if __name__ == "__main__":

Callers

nothing calls this directly

Calls 5

schedule_eventMethod · 0.95
tickMethod · 0.95
combined_eventsFunction · 0.90
EventGeneratorClass · 0.85
sendMethod · 0.45

Tested by

no test coverage detected