MCPcopy
hub / github.com/pallets/click / test_echo_stdin_stream

Function test_echo_stdin_stream

tests/test_testing.py:33–48  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

31
32
33def test_echo_stdin_stream():
34 @click.command()
35 def test():
36 i = click.get_binary_stream("stdin")
37 o = click.get_binary_stream("stdout")
38 while True:
39 chunk = i.read(4096)
40 if not chunk:
41 break
42 o.write(chunk)
43 o.flush()
44
45 runner = CliRunner(echo_stdin=True)
46 result = runner.invoke(test, input="Hello World!\n")
47 assert not result.exception
48 assert result.output == "Hello World!\nHello World!\n"
49
50
51def test_echo_stdin_prompts():

Callers

nothing calls this directly

Calls 2

invokeMethod · 0.95
CliRunnerClass · 0.90

Tested by

no test coverage detected