Skip to content

Commit 1a7bd55

Browse files
committed
Mock getheightwidth
1 parent e84f943 commit 1a7bd55

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

Lib/test/test_pyrepl.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ def handle_all_events(
104104

105105

106106
handle_events_narrow_console = partial(
107-
handle_all_events, prepare_console=partial(prepare_mock_console, width=10)
107+
handle_all_events,
108+
prepare_console=partial(prepare_mock_console, width=10, getheightwidth=MagicMock(lambda self: (25, 10))),
108109
)
109110

110111

@@ -944,13 +945,16 @@ def unix_console(events, **kwargs):
944945

945946
handle_events_unix_console = partial(handle_all_events, prepare_console=unix_console)
946947
handle_events_narrow_unix_console = partial(
947-
handle_all_events, prepare_console=partial(unix_console, width=5)
948+
handle_all_events,
949+
prepare_console=partial(unix_console, width=5, getheightwidth=MagicMock(lambda self: (25, 5))),
948950
)
949951
handle_events_short_unix_console = partial(
950-
handle_all_events, prepare_console=partial(unix_console, height=1)
952+
handle_all_events,
953+
prepare_console=partial(unix_console, height=1, getheightwidth=MagicMock(lambda self: (1, 80))),
951954
)
952955
handle_events_unix_console_height_3 = partial(
953-
handle_all_events, prepare_console=partial(unix_console, height=2)
956+
handle_all_events,
957+
prepare_console=partial(unix_console, height=3, getheightwidth=MagicMock(lambda self: (3, 80))),
954958
)
955959

956960

0 commit comments

Comments
 (0)