()
| 75 | |
| 76 | |
| 77 | def test_pex_builder_preamble(): |
| 78 | # type: () -> None |
| 79 | with temporary_dir() as td: |
| 80 | target = os.path.join(td, "foo.pex") |
| 81 | should_create = os.path.join(td, "foo.1") |
| 82 | |
| 83 | tempfile_preamble = "\n".join( |
| 84 | ["import sys", "open('{0}', 'w').close()".format(should_create), "sys.exit(3)"] |
| 85 | ) |
| 86 | |
| 87 | pb = PEXBuilder(preamble=tempfile_preamble) |
| 88 | pb.build(target) |
| 89 | |
| 90 | assert not os.path.exists(should_create) |
| 91 | |
| 92 | pex = PEX(target, interpreter=pb.interpreter) |
| 93 | process = pex.run(blocking=False) |
| 94 | process.wait() |
| 95 | |
| 96 | assert process.returncode == 3 |
| 97 | assert os.path.exists(should_create) |
| 98 | |
| 99 | |
| 100 | def test_pex_builder_compilation(): |
nothing calls this directly
no test coverage detected