MCPcopy Index your code
hub / github.com/python/cpython / unix_console

Function unix_console

Lib/test/test_pyrepl/test_unix_console.py:28–41  ·  view source on GitHub ↗
(events, **kwargs)

Source from the content-addressed store, hash-verified

26
27
28def unix_console(events, **kwargs):
29 console = UnixConsole(term="xterm")
30 console.get_event = MagicMock(side_effect=events)
31 console.getpending = MagicMock(return_value=Event("key", ""))
32
33 height = kwargs.get("height", 25)
34 width = kwargs.get("width", 80)
35 console.getheightwidth = MagicMock(side_effect=lambda: (height, width))
36 console.wait = MagicMock()
37
38 console.prepare()
39 for key, val in kwargs.items():
40 setattr(console, key, val)
41 return console
42
43
44handle_events_unix_console = partial(

Callers 1

Calls 6

prepareMethod · 0.95
UnixConsoleClass · 0.90
MagicMockClass · 0.90
EventClass · 0.90
getMethod · 0.45
itemsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…