GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — rhwp-python/tests/test_smoke.py at main · DanMeon/rhwp-python Expand file tree/ Copy pathtest_smoke.pyMore file actions 75 lines (51 loc) · 2.52 KB / Copy pathtest_smoke.pyFile metadata and controls75 lines (51 loc) · 2.52 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 """Stage 1 smoke tests — version/rhwp_core_version 동작 검증.""" import re import rhwp import pytest pytestmark = pytest.mark.spec("v0.1.0/rhwp-python") # ^ soft retrofit — file-level spec mapping; v0.4.0+ specs add #AC-N to specific tests (CONVENTIONS § Trace report) SEMVER_PATTERN = re.compile(r"^\d+\.\d+\.\d+(?:[-+].+)?$") def test_version_returns_string() -> None: assert isinstance(rhwp.version(), str) def test_version_matches_semver() -> None: v = rhwp.version() assert SEMVER_PATTERN.match(v), f"rhwp.version() = {v!r} — expected semver" def test_version_is_package_version() -> None: # ^ rhwp.version() 은 설치된 패키지 메타데이터와 일치 # (Cargo.toml → wheel metadata → rhwp.version() 파이프라인 검증, 버전 bump 와 독립) from importlib.metadata import version as pkg_version assert rhwp.version() == pkg_version("rhwp-python") def test_rhwp_core_version_returns_string() -> None: assert isinstance(rhwp.rhwp_core_version(), str) def test_rhwp_core_version_matches_semver() -> None: v = rhwp.rhwp_core_version() assert SEMVER_PATTERN.match(v), f"rhwp.rhwp_core_version() = {v!r} — expected semver" def test_all_exports_available() -> None: assert "version" in rhwp.__all__ assert "rhwp_core_version" in rhwp.__all__ def test_native_module_path() -> None: # ^ module-name = "rhwp._rhwp" (가이드 §2.4) 규약 준수 확인 # importlib 로 우회: _rhwp 는 내부 네이티브 모듈 — Stage 1 범위에서 별도 스텁 미작성 import importlib native = importlib.import_module("rhwp._rhwp") assert native.__name__ == "rhwp._rhwp" assert "version" in dir(native) assert "rhwp_core_version" in dir(native) def test_pyi_and_py_all_match() -> None: # ^ .py 와 .pyi 의 __all__ 동기화 검증 — Stage 추가 시 누락 방지 import ast from pathlib import Path assert rhwp.__file__ is not None pyi_path = Path(rhwp.__file__).with_suffix(".pyi") assert pyi_path.exists(), f"{pyi_path} not found" tree = ast.parse(pyi_path.read_text(encoding="utf-8")) for node in tree.body: if isinstance(node, ast.Assign) and any( isinstance(t, ast.Name) and t.id == "__all__" for t in node.targets ): pyi_all = set(ast.literal_eval(node.value)) assert pyi_all == set(rhwp.__all__), ( f".pyi __all__={pyi_all} vs .py __all__={set(rhwp.__all__)}" ) return raise AssertionError("__all__ not found in .pyi") |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |