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

Function test_execute_interpreter_file_program

tests/test_pex.py:806–824  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

804
805
806def test_execute_interpreter_file_program():
807 # type: () -> None
808 with temporary_dir() as pex_chroot:
809 pex_builder = PEXBuilder(path=pex_chroot)
810 pex_builder.freeze()
811 with tempfile.NamedTemporaryFile() as fp:
812 fp.write(b'import sys; print(" ".join(sys.argv))')
813 fp.flush()
814 process = PEX(pex_chroot).run(
815 args=[fp.name, "one", "two"],
816 stdout=subprocess.PIPE,
817 stderr=subprocess.PIPE,
818 blocking=False,
819 )
820 stdout, stderr = process.communicate()
821
822 assert 0 == process.returncode
823 assert "{} one two\n".format(fp.name).encode("utf-8") == stdout
824 assert b"" == stderr
825
826
827EXPECTED_REPL_BANNER_NO_DEPS = (

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected