Skip to content

Commit 8d90e66

Browse files
committed
test(config/toml_config): add test case to init_empty_config_file
1 parent ff0cac4 commit 8d90e66

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/test_conf.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,3 +132,13 @@ def test_set_key(configure_supported_files, config_files_manager):
132132

133133
def test_find_git_project_root():
134134
assert git.find_git_project_root() == Path(os.getcwd())
135+
136+
137+
class TestTomlConfig:
138+
def test_init_empty_config_file(self, tmpdir):
139+
path = tmpdir.mkdir("commitizen").join('.cz.toml')
140+
toml_config = config.TomlConfig(data="", path=path)
141+
toml_config.init_empty_config_file()
142+
143+
with open(path, "r") as toml_file:
144+
assert toml_file.read() == "[tool.commitizen]"

0 commit comments

Comments
 (0)