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
1
from __future__ import annotations
2
2
3
+ import os
3
4
import re
4
5
from dataclasses import dataclass
5
6
from pathlib import Path
@@ -1640,7 +1641,7 @@ def test_tags_rules_get_version_tags(capsys: pytest.CaptureFixture):
1640
1641
1641
1642
def test_changelog_file_name_from_args_and_config ():
1642
1643
mock_config = Mock (spec = BaseConfig )
1643
- mock_config .path .parent = "/my/project/ "
1644
+ mock_config .path .parent = "/my/project"
1644
1645
mock_config .settings = {
1645
1646
"name" : "cz_conventional_commits" ,
1646
1647
"changelog_file" : "CHANGELOG.md" ,
@@ -1660,8 +1661,12 @@ def test_changelog_file_name_from_args_and_config():
1660
1661
"unreleased_version" : "1.0.1" ,
1661
1662
}
1662
1663
changelog = Changelog (mock_config , args )
1663
- assert changelog .file_name == "/my/project/CUSTOM.md"
1664
+ assert os .path .normpath (changelog .file_name ) == os .path .normpath (
1665
+ os .path .join ("/my/project" , "CUSTOM.md" )
1666
+ )
1664
1667
1665
1668
args = {"incremental" : None , "dry_run" : False , "unreleased_version" : "1.0.1" }
1666
1669
changelog = Changelog (mock_config , args )
1667
- assert changelog .file_name == "/my/project/CHANGELOG.md"
1670
+ assert os .path .normpath (changelog .file_name ) == os .path .normpath (
1671
+ os .path .join ("/my/project" , "CHANGELOG.md" )
1672
+ )
You can’t perform that action at this time.
0 commit comments