@@ -459,6 +459,20 @@ def test_r_scope__scopes(conventional_commit_scope_required):
459
459
assert not regex .match ("(api; client)" )
460
460
461
461
462
+ def test_r_scope__scopes_uppercase (conventional_commit_scope_required ):
463
+ conventional_commit_scope_required .scopes = ["api" , "client" ]
464
+ regex = re .compile (conventional_commit_scope_required .r_scope )
465
+
466
+ assert regex .match ("(API)" )
467
+ assert regex .match ("(CLIENT)" )
468
+ assert regex .match ("(API, CLIENT)" )
469
+ assert regex .match ("(API: CLIENT)" )
470
+ assert regex .match ("(API/CLIENT)" )
471
+ assert regex .match ("(API-CLIENT)" )
472
+ assert not regex .match ("(TEST)" )
473
+ assert not regex .match ("(API; CLIENT)" )
474
+
475
+
462
476
def test_r_delim (conventional_commit ):
463
477
regex = re .compile (conventional_commit .r_delim )
464
478
@@ -565,13 +579,27 @@ def test_is_valid__default_type(conventional_commit, type):
565
579
assert conventional_commit .is_valid (input )
566
580
567
581
582
+ @pytest .mark .parametrize ("type" , ConventionalCommit .DEFAULT_TYPES )
583
+ def test_is_valid__default_type_uppercase (conventional_commit , type ):
584
+ input = f"{ type .upper ()} : message"
585
+
586
+ assert conventional_commit .is_valid (input )
587
+
588
+
568
589
@pytest .mark .parametrize ("type" , ConventionalCommit .CONVENTIONAL_TYPES )
569
590
def test_is_valid__conventional_type (conventional_commit , type ):
570
591
input = f"{ type } : message"
571
592
572
593
assert conventional_commit .is_valid (input )
573
594
574
595
596
+ @pytest .mark .parametrize ("type" , ConventionalCommit .CONVENTIONAL_TYPES )
597
+ def test_is_valid__conventional_type_uppercase (conventional_commit , type ):
598
+ input = f"{ type .upper ()} : message"
599
+
600
+ assert conventional_commit .is_valid (input )
601
+
602
+
575
603
@pytest .mark .parametrize ("type" , CUSTOM_TYPES )
576
604
def test_is_valid__custom_type (type ):
577
605
input = f"{ type } : message"
@@ -588,6 +616,14 @@ def test_is_valid__conventional_custom_type(type):
588
616
assert conventional_commits .is_valid (input )
589
617
590
618
619
+ @pytest .mark .parametrize ("type" , ConventionalCommit .CONVENTIONAL_TYPES )
620
+ def test_is_valid__conventional_custom_type_uppercase (type ):
621
+ input = f"{ type .upper ()} : message"
622
+ conventional_commits = ConventionalCommit (types = CUSTOM_TYPES )
623
+
624
+ assert conventional_commits .is_valid (input )
625
+
626
+
591
627
def test_is_valid__breaking_change (conventional_commit ):
592
628
input = "fix!: message"
593
629
0 commit comments