MCPcopy
hub / github.com/pex-tool/pex / test_execute_interpreter_stdin_program

Function test_execute_interpreter_stdin_program

tests/test_pex.py:762–778  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

760
761
762def test_execute_interpreter_stdin_program():
763 # type: () -> None
764 with temporary_dir() as pex_chroot:
765 pex_builder = PEXBuilder(path=pex_chroot)
766 pex_builder.freeze()
767 process = PEX(pex_chroot).run(
768 args=["-", "one", "two"],
769 stdout=subprocess.PIPE,
770 stderr=subprocess.PIPE,
771 stdin=subprocess.PIPE,
772 blocking=False,
773 )
774 stdout, stderr = process.communicate(input=b'import sys; print(" ".join(sys.argv))')
775
776 assert 0 == process.returncode
777 assert b"- one two\n" == stdout
778 assert b"" == stderr
779
780
781def test_execute_interpreter_stdin_program_with_python_options():

Callers

nothing calls this directly

Calls 6

freezeMethod · 0.95
temporary_dirFunction · 0.90
PEXBuilderClass · 0.90
PEXClass · 0.90
communicateMethod · 0.80
runMethod · 0.45

Tested by

no test coverage detected