Skip to content

Commit 4f3931a

Browse files
crai0Lee-W
authored andcommitted
test(utils): add test for get_backup_file_path when git.find_project_root returns None
1 parent 820ada2 commit 4f3931a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/test_cz_utils.py

+7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import pytest
2+
from pytest_mock import MockFixture
23

34
from commitizen.cz import exceptions, utils
45

@@ -17,3 +18,9 @@ def test_multiple_line_breaker():
1718

1819
result = utils.multiple_line_breaker(message, "is")
1920
assert result == "th\n\nthe first line | and th\n\nthe second line"
21+
22+
23+
def test_get_backup_file_path_no_project_root(mocker: MockFixture):
24+
project_root_mock = mocker.patch("commitizen.git.find_git_project_root")
25+
project_root_mock.return_value = None
26+
assert utils.get_backup_file_path()

0 commit comments

Comments
 (0)