28 lines
757 B
Python
28 lines
757 B
Python
"""包基线冒烟测试:可导入、版本号存在。"""
|
|
|
|
from pathlib import Path
|
|
|
|
import polygateway
|
|
|
|
|
|
def test_package_importable_with_version() -> None:
|
|
import tomllib
|
|
|
|
declared = tomllib.loads(Path("pyproject.toml").read_text())["project"]["version"]
|
|
assert polygateway.__version__ == declared # 单一版本源: 与 pyproject 同步
|
|
|
|
|
|
def test_ocr_public_surface_exported():
|
|
"""M3 OCR 公共 API 面(设计 §3;transport 结果与 Protocol 不出顶层)。"""
|
|
import polygateway
|
|
|
|
for name in (
|
|
"OcrClient",
|
|
"OcrSettings",
|
|
"OcrTextResult",
|
|
"OcrLayoutResult",
|
|
"OcrLayoutElement",
|
|
):
|
|
assert hasattr(polygateway, name), name
|
|
assert name in polygateway.__all__, name
|