Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BJKMLHdxMwSUeYcdkwqX4W
22 lines
616 B
Python
22 lines
616 B
Python
from pathlib import Path
|
|
|
|
from arm_statements.version import statements_version
|
|
|
|
FULL_HASH = "abc1234def5678abc1234def5678abc1234def56"
|
|
|
|
|
|
def test_version_absent_in_source() -> None:
|
|
assert statements_version() is None
|
|
|
|
|
|
def test_version_read_from_file(tmp_path: Path) -> None:
|
|
marker = tmp_path / "VERSION"
|
|
marker.write_text(f"{FULL_HASH}\n", encoding="utf-8")
|
|
assert statements_version(marker) == FULL_HASH
|
|
|
|
|
|
def test_version_empty_file_is_none(tmp_path: Path) -> None:
|
|
marker = tmp_path / "VERSION"
|
|
marker.write_text(" \n", encoding="utf-8")
|
|
assert statements_version(marker) is None
|