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

Function test_pex_script

tests/test_pex.py:290–306  ·  view source on GitHub ↗
(project_name, zip_safe)

Source from the content-addressed store, hash-verified

288@pytest.mark.parametrize("zip_safe", (False, True))
289@pytest.mark.parametrize("project_name", ("my_project", "my-project"))
290def test_pex_script(project_name, zip_safe):
291 # type: (str, bool) -> None
292 with make_bdist(name=project_name, zip_safe=zip_safe) as bdist:
293 env_copy = os.environ.copy()
294 env_copy["PEX_SCRIPT"] = "hello_world"
295 so, rc = run_simple_pex_test("", env=env_copy)
296 assert rc == 1, so.decode("utf-8")
297 assert b"Could not find script 'hello_world'" in so
298
299 so, rc = run_simple_pex_test("", env=env_copy, dists=[bdist])
300 assert rc == 0, so.decode("utf-8")
301 assert b"hello world" in so
302
303 env_copy["PEX_SCRIPT"] = "shell_script"
304 so, rc = run_simple_pex_test("", env=env_copy, dists=[bdist])
305 assert rc == 0, so.decode("utf-8")
306 assert b"hello world from shell script" in so
307
308
309def test_pex_run():

Callers

nothing calls this directly

Calls 4

make_bdistFunction · 0.90
run_simple_pex_testFunction · 0.90
decodeMethod · 0.80
copyMethod · 0.45

Tested by

no test coverage detected