Skip to content

Commit 669cd46

Browse files
test: add validity tests for uppercase types
1 parent fa1915d commit 669cd46

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

tests/test_format.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -565,13 +565,27 @@ def test_is_valid__default_type(conventional_commit, type):
565565
assert conventional_commit.is_valid(input)
566566

567567

568+
@pytest.mark.parametrize("type", ConventionalCommit.DEFAULT_TYPES)
569+
def test_is_valid__default_type_uppercase(conventional_commit, type):
570+
input = f"{type.upper()}: message"
571+
572+
assert conventional_commit.is_valid(input)
573+
574+
568575
@pytest.mark.parametrize("type", ConventionalCommit.CONVENTIONAL_TYPES)
569576
def test_is_valid__conventional_type(conventional_commit, type):
570577
input = f"{type}: message"
571578

572579
assert conventional_commit.is_valid(input)
573580

574581

582+
@pytest.mark.parametrize("type", ConventionalCommit.CONVENTIONAL_TYPES)
583+
def test_is_valid__conventional_type_uppercase(conventional_commit, type):
584+
input = f"{type.upper()}: message"
585+
586+
assert conventional_commit.is_valid(input)
587+
588+
575589
@pytest.mark.parametrize("type", CUSTOM_TYPES)
576590
def test_is_valid__custom_type(type):
577591
input = f"{type}: message"
@@ -588,6 +602,14 @@ def test_is_valid__conventional_custom_type(type):
588602
assert conventional_commits.is_valid(input)
589603

590604

605+
@pytest.mark.parametrize("type", ConventionalCommit.CONVENTIONAL_TYPES)
606+
def test_is_valid__conventional_custom_type_uppercase(type):
607+
input = f"{type.upper()}: message"
608+
conventional_commits = ConventionalCommit(types=CUSTOM_TYPES)
609+
610+
assert conventional_commits.is_valid(input)
611+
612+
591613
def test_is_valid__breaking_change(conventional_commit):
592614
input = "fix!: message"
593615

0 commit comments

Comments
 (0)