(tmpdir)
| 36 | |
| 37 | |
| 38 | def test_script(tmpdir): |
| 39 | # type: (Any) -> None |
| 40 | |
| 41 | pex = os.path.join(str(tmpdir), "pex") |
| 42 | |
| 43 | # N.B.: `make_project` defines setuptools `scripts` for "hello_world" and "shell_script". |
| 44 | with make_project( |
| 45 | entry_points={"console_scripts": ["my_app = my_project.my_module:do_something"]}, |
| 46 | ) as project: |
| 47 | |
| 48 | run_pex_command(args=[project, "-c", "my_app", "-o", pex]).assert_success() |
| 49 | assert b"hello world!\n" == subprocess.check_output(args=[pex]) |
| 50 | |
| 51 | run_pex_command(args=[project, "-c", "hello_world", "-o", pex]).assert_success() |
| 52 | assert b"hello world from py script!\n" == subprocess.check_output(args=[pex]) |
| 53 | |
| 54 | run_pex_command(args=[project, "-c", "shell_script", "-o", pex]).assert_success() |
| 55 | assert b"hello world from shell script\n" == subprocess.check_output(args=[pex]) |
| 56 | |
| 57 | |
| 58 | def test_entry_point(tmpdir): |
nothing calls this directly
no test coverage detected