Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test: add test to cover schema_pattern is None case
  • Loading branch information
benediktziegler committed Sep 13, 2024
commit 7bd16c3456216adecf2b317b97aab981cbf105bb
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