Adding upstream version 4.6.0+dfsg.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
f3ad83a1a5
commit
167a3f8553
275 changed files with 30423 additions and 0 deletions
26
tests/test_cz_utils.py
Normal file
26
tests/test_cz_utils.py
Normal file
|
@ -0,0 +1,26 @@
|
|||
import pytest
|
||||
from pytest_mock import MockFixture
|
||||
|
||||
from commitizen.cz import exceptions, utils
|
||||
|
||||
|
||||
def test_required_validator():
|
||||
assert utils.required_validator("test") == "test"
|
||||
|
||||
with pytest.raises(exceptions.AnswerRequiredError):
|
||||
utils.required_validator("")
|
||||
|
||||
|
||||
def test_multiple_line_breaker():
|
||||
message = "this is the first line | and this is the second line "
|
||||
result = utils.multiple_line_breaker(message)
|
||||
assert result == "this is the first line\nand this is the second line"
|
||||
|
||||
result = utils.multiple_line_breaker(message, "is")
|
||||
assert result == "th\n\nthe first line | and th\n\nthe second line"
|
||||
|
||||
|
||||
def test_get_backup_file_path_no_project_root(mocker: MockFixture):
|
||||
project_root_mock = mocker.patch("commitizen.git.find_git_project_root")
|
||||
project_root_mock.return_value = None
|
||||
assert utils.get_backup_file_path()
|
Loading…
Add table
Add a link
Reference in a new issue