()
| 82 | # B. parse_changelog / get_release_notes_for_version |
| 83 | # --------------------------------------------------------------------------- # |
| 84 | def test_parse_changelog(): |
| 85 | parsed = parse_changelog(_CHANGELOG) |
| 86 | # Preamble (before the first ## heading) is skipped — its bullet must not leak. |
| 87 | assert all("preamble" not in n for notes in parsed.values() for n in notes) |
| 88 | # Keep-a-Changelog heading normalizes to the bare version key. |
| 89 | assert parsed["0.5.0"] == ["new thing one", "new thing two", "a bug fix"] |
| 90 | # ### sub-headers are ignored (bullets collected flat); '* ' bullets accepted. |
| 91 | # Bullet-less sections are dropped entirely. |
| 92 | assert "0.4.0" not in parsed |
| 93 | assert parsed["0.1.0"] == ["initial release"] |
| 94 | assert parse_changelog("") == {} |
| 95 | |
| 96 | |
| 97 | def test_get_release_notes_for_version(): |
nothing calls this directly
no test coverage detected