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

Function assert_entry_points

tests/test_bdist_pex.py:78–88  ·  view source on GitHub ↗
(entry_points, bdist_args=None)

Source from the content-addressed store, hash-verified

76
77
78def assert_entry_points(entry_points, bdist_args=None):
79 # type: (Union[str, Dict[str, List[str]]], Optional[Iterable[str]]) -> Iterator[str]
80 with make_project(name="my_app", entry_points=entry_points) as project_dir:
81 with bdist_pex(project_dir, bdist_args) as apps_pex:
82 for app_pex in apps_pex:
83 process = subprocess.Popen([app_pex], stdout=subprocess.PIPE)
84 stdout, _ = process.communicate()
85 assert "{pex_root}" not in os.listdir(project_dir)
86 assert 0 == process.returncode
87 assert stdout == b"hello world!\n"
88 yield os.path.basename(app_pex)
89
90
91def assert_pex_args_shebang(shebang):

Calls 3

make_projectFunction · 0.90
communicateMethod · 0.80
bdist_pexFunction · 0.70

Tested by

no test coverage detected