Files
linkerhand_retarget_ros2/src/linkerhand_calibration/test/test_package_rename.py
T

27 lines
906 B
Python

import importlib
from pathlib import Path
import re
import pytest
def test_legacy_python_package_forwards_only_public_config_api() -> None:
with pytest.warns(DeprecationWarning, match="linkerhand_calibration"):
legacy = importlib.import_module("g20_thumb_apriltag_calibration")
current = importlib.import_module("linkerhand_calibration.product")
assert legacy.ProductConfig is current.ProductConfig
assert legacy.load_product_config is current.load_product_config
def test_new_and_legacy_executable_names_share_one_implementation() -> None:
setup_text = (Path(__file__).resolve().parents[1] / "setup.py").read_text(
encoding="utf-8"
)
for executable in ("calibrate_hand", "calibrate_g20_right"):
assert re.search(
rf'"{executable} = "\s*'
r'"linkerhand_calibration\.runtime\.runner:main"',
setup_text,
)