1
+ import os
1
2
import re
2
3
from dataclasses import dataclass
3
4
from pathlib import Path
4
- from unittest .mock import Mock
5
5
from typing import Any , Optional
6
+ from unittest .mock import Mock
6
7
7
8
import pytest
8
9
from jinja2 import FileSystemLoader
@@ -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
+ )
0 commit comments