Some checks are pending
Tests & Quality Checks / Test on Python 3.11 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.12 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.11-1 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.12-1 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.10 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.11-2 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.12-2 (push) Waiting to run
Tests & Quality Checks / Build Artifacts (push) Blocked by required conditions
Tests & Quality Checks / Build Artifacts-1 (push) Blocked by required conditions
46 lines
1.2 KiB
Python
46 lines
1.2 KiB
Python
"""Tests for build script version utilities."""
|
|
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
sys.path.insert(0, str(Path(__file__).resolve().parents[2] / "build" / "scripts"))
|
|
|
|
from version_utils import get_release_notes
|
|
|
|
|
|
class TestReleaseNotes:
|
|
"""Test release note extraction for published releases."""
|
|
|
|
def test_get_release_notes_from_changelog(self, tmp_path):
|
|
"""Extract only the selected version section from the changelog."""
|
|
changelog = tmp_path / "CHANGELOG.md"
|
|
changelog.write_text(
|
|
"""## [0.9.1] - 2026-04-15
|
|
|
|
### Added
|
|
- Better update text
|
|
- New installer checks
|
|
|
|
### Fixed
|
|
- Upload retries
|
|
|
|
## [0.9.0] - 2026-04-01
|
|
|
|
### Added
|
|
- Older changes
|
|
""",
|
|
encoding="utf-8",
|
|
)
|
|
|
|
notes = get_release_notes("0.9.1", project_root=tmp_path)
|
|
|
|
assert "Better update text" in notes
|
|
assert "New installer checks" in notes
|
|
assert "Older changes" not in notes
|
|
|
|
def test_get_release_notes_uses_fallback_when_missing(self, tmp_path):
|
|
"""Return a readable fallback when no changelog entry exists."""
|
|
notes = get_release_notes("0.9.1", project_root=tmp_path)
|
|
|
|
assert "WebDrop Bridge v0.9.1" in notes
|
|
assert "release package" in notes.lower()
|