-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix AttributeError with docutils >= 0.18 (#352)
Co-authored-by: Scott K Logan <[email protected]>
- Loading branch information
Showing
2 changed files
with
44 additions
and
1 deletion.
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,43 @@ | ||
# coding=utf-8 | ||
|
||
from catkin_pkg.cli.tag_changelog import get_forthcoming_label | ||
from catkin_pkg.cli.tag_changelog import rename_section | ||
|
||
single_forthcoming_rst = """\ | ||
^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
Changelog for package foo | ||
^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
Forthcoming | ||
----------- | ||
* Initial release | ||
* Initial bugs | ||
* Contributors: Sömeöne with UTF-8 in their name | ||
""" | ||
|
||
single_version_rst = """\ | ||
^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
Changelog for package foo | ||
^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
0.0.1 (2012-01-31) | ||
------------------ | ||
* Initial release | ||
* Initial bugs | ||
* Contributors: Sömeöne with UTF-8 in their name | ||
""" | ||
|
||
|
||
def test_get_forthcoming_label(): | ||
assert get_forthcoming_label(single_version_rst) is None | ||
assert get_forthcoming_label(single_forthcoming_rst) == 'Forthcoming' | ||
|
||
|
||
def test_rename_section(): | ||
res = rename_section( | ||
single_forthcoming_rst, | ||
'Forthcoming', | ||
'0.0.1 (2012-01-31)') | ||
assert res == single_version_rst |