Skip to content

Commit 74654df

Browse files
committed
test(git): add test case for find_git_project_root
1 parent 8d90e66 commit 74654df

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/test_conf.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,13 +130,16 @@ def test_set_key(configure_supported_files, config_files_manager):
130130
assert cfg.settings == _new_settings
131131

132132

133-
def test_find_git_project_root():
133+
def test_find_git_project_root(tmpdir):
134134
assert git.find_git_project_root() == Path(os.getcwd())
135135

136+
with tmpdir.as_cwd() as tmp_cwd:
137+
assert git.find_git_project_root() == None
138+
136139

137140
class TestTomlConfig:
138141
def test_init_empty_config_file(self, tmpdir):
139-
path = tmpdir.mkdir("commitizen").join('.cz.toml')
142+
path = tmpdir.mkdir("commitizen").join(".cz.toml")
140143
toml_config = config.TomlConfig(data="", path=path)
141144
toml_config.init_empty_config_file()
142145

0 commit comments

Comments
 (0)