tests.test_release_sync module¶
Tests for repomatic.github.release_sync: changelog-to-release-notes sync.
- tests.test_release_sync.test_build_expected_body_with_admonition()[source]¶
Extraction preserves admonitions when they appear in the changes group.
- tests.test_release_sync.test_build_expected_body_admonition_override()[source]¶
Override replaces the changelog’s availability admonition.
- tests.test_release_sync.test_build_expected_body_admonition_override_no_original()[source]¶
Override injects an admonition where none existed in the changelog.
- tests.test_release_sync.test_build_expected_body_editorial_only()[source]¶
Version with only editorial admonition returns non-empty body.
- tests.test_release_sync.test_build_expected_body_missing_version()[source]¶
Returns empty string for a missing version.
- tests.test_release_sync.test_build_expected_body_includes_all_elements()[source]¶
The github-releases template includes all elements like release-notes.
- tests.test_release_sync.test_build_expected_body_decomposes_elements()[source]¶
Verifies the decompose → template path produces correct output.
- tests.test_release_sync.test_build_expected_body_includes_full_changelog_link()[source]¶
The github-releases template appends a full changelog link.
- tests.test_release_sync.test_normalize_body(text, expected)[source]¶
Whitespace normalization edge cases.
- tests.test_release_sync.changelog_path(tmp_path)[source]¶
A changelog file on disk holding
SAMPLE_CHANGELOG.
- tests.test_release_sync.expected_body(version)[source]¶
The release body
sync_github_releaseswould render for version.- Return type:
- tests.test_release_sync.run_sync(changelog_path, releases, *, dry_run=True, edit_result=None)[source]¶
Drive
sync_github_releasesagainst canned GitHub state.- Parameters:
changelog_path – The changelog the expected bodies are derived from.
releases – Version to
GitHubRelease, as the API would return them.dry_run – Passed straight through to the command.
edit_result – When set,
edit_release_notesis patched to return it and the mock is handed back beside the result so a caller can assert on the calls. LeftNone, no mutation seam is installed.
- Returns:
The sync result, or
(result, edit_mock)when edit_result is set.
- tests.test_release_sync.test_sync_all_in_sync(changelog_path)[source]¶
No updates when all bodies match.
- tests.test_release_sync.test_sync_detects_drift(changelog_path)[source]¶
Flags releases with different bodies in dry-run.
- tests.test_release_sync.test_sync_dry_run_no_mutations(changelog_path)[source]¶
Dry-run doesn’t call
gh release edit.
- tests.test_release_sync.test_sync_live_updates(changelog_path)[source]¶
Live mode calls
gh release editwith correct args.
- tests.test_release_sync.test_sync_missing_changelog_section(changelog_path)[source]¶
A GitHub release with no changelog section is never iterated.