MCPcopy Create free account
hub / github.com/executablebooks/markdown-it-py / test_interactive_render

Function test_interactive_render

tests/test_cli.py:83–97  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

81
82
83def test_interactive_render():
84 # Simulate user typing '# hello', pressing Ctrl-D (renders), then Ctrl-C (exits)
85 # This is needed to break the infinite loop in interactive mode on EOF.
86 mock_input = patch(
87 "builtins.input", side_effect=["# hello", EOFError, KeyboardInterrupt]
88 )
89 string_io = io.StringIO()
90 with redirect_stdout(string_io), mock_input:
91 parse.interactive()
92
93 output = string_io.getvalue()
94 assert "markdown-it-py" in output # from print_heading
95 # The rendered output is prefixed by a newline
96 assert "\n<h1>hello</h1>\n" in output
97 assert "Exiting" in output

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…