Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit da79d1e

Browse files
committed
test(cz/customize): cover customized info from info_path
1 parent 799e373 commit da79d1e

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tests/test_cz_customize.py

+19
Original file line numberDiff line numberDiff line change
@@ -117,3 +117,22 @@ def test_schema(config):
117117
def test_info(config):
118118
cz = CustomizeCommitsCz(config)
119119
assert "This is a customized cz." in cz.info()
120+
121+
122+
def test_info_with_info_path(tmpdir):
123+
with tmpdir.as_cwd():
124+
tmpfile = tmpdir.join("info.txt")
125+
tmpfile.write("Test info")
126+
127+
toml_str = """
128+
[tool.commitizen.customize]
129+
message_template = "{{change_type}}:{% if show_message %} {{message}}{% endif %}"
130+
example = "feature: this feature enable customize through config file"
131+
schema = "<type>: <body>"
132+
bump_pattern = "^(break|new|fix|hotfix)"
133+
bump_map = {"break" = "MAJOR", "new" = "MINOR", "fix" = "PATCH", "hotfix" = "PATCH"}
134+
info_path = "info.txt"
135+
"""
136+
config = TomlConfig(data=toml_str, path="not_exist.toml")
137+
cz = CustomizeCommitsCz(config)
138+
assert "Test info" in cz.info()

0 commit comments

Comments
 (0)