-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
73 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
"""Tests for the release utils.""" | ||
|
||
import pytest | ||
|
||
from extra.release import changelog_as_markdown | ||
|
||
|
||
@pytest.fixture | ||
def rst_changelog(): | ||
return """New features: | ||
* :doc:`/plugins/substitute`: Some substitute | ||
multi-line change. | ||
:bug:`5467` | ||
Bug fixes: | ||
* Some fix that refers to an issue. | ||
:bug:`5467` | ||
* Some fix that mentions a user @user. | ||
Empty section: | ||
Other changes: | ||
* Changed `bitesize` label to `good first issue`. Our `contribute`_ page is now | ||
automatically populated with these issues. :bug:`4855` | ||
.. _contribute: https://github.com/beetbox/beets/contribute | ||
2.1.0 (November 22, 2024) | ||
------------------------- | ||
Bug fixes: | ||
* Fixed something.""" | ||
|
||
|
||
@pytest.fixture | ||
def md_changelog(): | ||
return r"""### New features | ||
- Plugin **`substitute`**: Some substitute multi-line change. :bug: (\#5467) | ||
### Bug fixes | ||
- Some fix that mentions a user @user. | ||
- Some fix that refers to an issue. :bug: (\#5467) | ||
### Other changes | ||
# 2.1.0 (November 22, 2024) | ||
- Changed `bitesize` label to `good first issue`. Our [contribute](https://github.com/beetbox/beets/contribute) page is now automatically populated with these issues. :bug: (\#4855) | ||
### Bug fixes | ||
- Fixed something.""" # noqa: E501 | ||
|
||
|
||
def test_convert_rst_to_md(rst_changelog, md_changelog): | ||
actual = changelog_as_markdown(rst_changelog) | ||
|
||
assert actual == md_changelog |