test-crates/pyo3-pure/check_installed/check_installed.py
raw| 1 | #!/usr/bin/env python3 |
| 2 | import os |
| 3 | import subprocess |
| 4 | |
| 5 | import pyo3_pure |
| 6 | |
| 7 | assert pyo3_pure.DummyClass.get_42() == 42 |
| 8 | |
| 9 | # Check type stub |
| 10 | install_path = os.path.join(os.path.dirname(pyo3_pure.__file__)) |
| 11 | assert os.path.exists(os.path.join(install_path, "__init__.pyi")) |
| 12 | assert os.path.exists(os.path.join(install_path, "py.typed")) |
| 13 | |
| 14 | # Check entrypoints |
| 15 | assert subprocess.run(["get_42"]).returncode == 42 |
| 16 | |
| 17 | print("SUCCESS") |