File tree 2 files changed +10
-4
lines changed
Filter options
2 files changed +10
-4
lines changed
Original file line number Diff line number Diff line change 1
1
from __future__ import annotations
2
2
3
+ import os
3
4
import os .path
4
5
from difflib import SequenceMatcher
5
6
from operator import itemgetter
@@ -42,7 +43,7 @@ def __init__(self, config: BaseConfig, args):
42
43
f"or the setting `changelog_file` in { self .config .path } "
43
44
)
44
45
self .file_name = (
45
- str (Path ( self .config .path .parent ) / changelog_file_name )
46
+ os . path . join ( str (self .config .path .parent ), changelog_file_name )
46
47
if self .config .path is not None
47
48
else changelog_file_name
48
49
)
Original file line number Diff line number Diff line change
1
+ import os
1
2
import re
2
3
from dataclasses import dataclass
3
4
from pathlib import Path
@@ -1638,7 +1639,7 @@ def test_tags_rules_get_version_tags(capsys: pytest.CaptureFixture):
1638
1639
1639
1640
def test_changelog_file_name_from_args_and_config ():
1640
1641
mock_config = Mock (spec = BaseConfig )
1641
- mock_config .path .parent = "/my/project/ "
1642
+ mock_config .path .parent = "/my/project"
1642
1643
mock_config .settings = {
1643
1644
"name" : "cz_conventional_commits" ,
1644
1645
"changelog_file" : "CHANGELOG.md" ,
@@ -1658,8 +1659,12 @@ def test_changelog_file_name_from_args_and_config():
1658
1659
"unreleased_version" : "1.0.1" ,
1659
1660
}
1660
1661
changelog = Changelog (mock_config , args )
1661
- assert changelog .file_name == "/my/project/CUSTOM.md"
1662
+ assert os .path .normpath (changelog .file_name ) == os .path .normpath (
1663
+ os .path .join ("/my/project" , "CUSTOM.md" )
1664
+ )
1662
1665
1663
1666
args = {"incremental" : None , "dry_run" : False , "unreleased_version" : "1.0.1" }
1664
1667
changelog = Changelog (mock_config , args )
1665
- assert changelog .file_name == "/my/project/CHANGELOG.md"
1668
+ assert os .path .normpath (changelog .file_name ) == os .path .normpath (
1669
+ os .path .join ("/my/project" , "CHANGELOG.md" )
1670
+ )
You can’t perform that action at this time.
0 commit comments