Skip to content

Commit

Permalink
test: add test to cover schema_pattern is None case
Browse files Browse the repository at this point in the history
  • Loading branch information
benediktziegler committed Sep 13, 2024
1 parent f66afbc commit 7bd16c3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/test_cz_base.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from typing import Optional

import pytest

from commitizen.cz.base import BaseCommitizen
Expand All @@ -10,6 +12,9 @@ def questions(self):
def message(self, answers: dict):
return answers["commit"]

def schema_pattern(self) -> Optional[str]:
return None


def test_base_raises_error(config):
with pytest.raises(TypeError):
Expand Down Expand Up @@ -38,6 +43,11 @@ def test_schema(config):
cz.schema()


def test_validate_commit_message(config):
cz = DummyCz(config)
assert cz.validate_commit_message("test", None, False, [], 0) == (True, [])


def test_info(config):
cz = DummyCz(config)
with pytest.raises(NotImplementedError):
Expand Down

0 comments on commit 7bd16c3

Please sign in to comment.