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
50
tests/test_cz_base.py
Normal file
50
tests/test_cz_base.py
Normal file
|
@ -0,0 +1,50 @@
|
|||
import pytest
|
||||
|
||||
from commitizen.cz.base import BaseCommitizen
|
||||
|
||||
|
||||
class DummyCz(BaseCommitizen):
|
||||
def questions(self):
|
||||
return [{"type": "input", "name": "commit", "message": "Initial commit:\n"}]
|
||||
|
||||
def message(self, answers: dict):
|
||||
return answers["commit"]
|
||||
|
||||
|
||||
def test_base_raises_error(config):
|
||||
with pytest.raises(TypeError):
|
||||
BaseCommitizen(config)
|
||||
|
||||
|
||||
def test_questions(config):
|
||||
cz = DummyCz(config)
|
||||
assert isinstance(cz.questions(), list)
|
||||
|
||||
|
||||
def test_message(config):
|
||||
cz = DummyCz(config)
|
||||
assert cz.message({"commit": "holis"}) == "holis"
|
||||
|
||||
|
||||
def test_example(config):
|
||||
cz = DummyCz(config)
|
||||
with pytest.raises(NotImplementedError):
|
||||
cz.example()
|
||||
|
||||
|
||||
def test_schema(config):
|
||||
cz = DummyCz(config)
|
||||
with pytest.raises(NotImplementedError):
|
||||
cz.schema()
|
||||
|
||||
|
||||
def test_info(config):
|
||||
cz = DummyCz(config)
|
||||
with pytest.raises(NotImplementedError):
|
||||
cz.info()
|
||||
|
||||
|
||||
def test_process_commit(config):
|
||||
cz = DummyCz(config)
|
||||
message = cz.process_commit("test(test_scope): this is test msg")
|
||||
assert message == "test(test_scope): this is test msg"
|
Loading…
Add table
Add a link
Reference in a new issue