Adding upstream version 4.6.0+dfsg.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
f3ad83a1a5
commit
7791e7adfd
230 changed files with 24945 additions and 0 deletions
26
tests/commands/test_example_command.py
Normal file
26
tests/commands/test_example_command.py
Normal file
|
@ -0,0 +1,26 @@
|
|||
import sys
|
||||
|
||||
import pytest
|
||||
from pytest_mock import MockerFixture
|
||||
|
||||
from commitizen import cli, commands
|
||||
from tests.utils import skip_below_py_3_10
|
||||
|
||||
|
||||
def test_example(config, mocker: MockerFixture):
|
||||
write_mock = mocker.patch("commitizen.out.write")
|
||||
commands.Example(config)()
|
||||
write_mock.assert_called_once()
|
||||
|
||||
|
||||
@skip_below_py_3_10
|
||||
def test_example_command_shows_description_when_use_help_option(
|
||||
mocker: MockerFixture, capsys, file_regression
|
||||
):
|
||||
testargs = ["cz", "example", "--help"]
|
||||
mocker.patch.object(sys, "argv", testargs)
|
||||
with pytest.raises(SystemExit):
|
||||
cli.main()
|
||||
|
||||
out, _ = capsys.readouterr()
|
||||
file_regression.check(out, extension=".txt")
|
Loading…
Add table
Add a link
Reference in a new issue