summaryrefslogtreecommitdiffstats
path: root/gitlint/tests/rules/test_meta_rules.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2020-11-03 06:07:45 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2020-11-03 06:07:45 +0000
commit5f208e04c159791e668031a7fa83f98724ec8d24 (patch)
tree4b58b42fd2a91a14871010e2dd39369a839ae383 /gitlint/tests/rules/test_meta_rules.py
parentAdding upstream version 0.13.1. (diff)
downloadgitlint-5f208e04c159791e668031a7fa83f98724ec8d24.tar.xz
gitlint-5f208e04c159791e668031a7fa83f98724ec8d24.zip
Adding upstream version 0.14.0.upstream/0.14.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'gitlint/tests/rules/test_meta_rules.py')
-rw-r--r--gitlint/tests/rules/test_meta_rules.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/gitlint/tests/rules/test_meta_rules.py b/gitlint/tests/rules/test_meta_rules.py
index c94b8b3..987aa88 100644
--- a/gitlint/tests/rules/test_meta_rules.py
+++ b/gitlint/tests/rules/test_meta_rules.py
@@ -32,6 +32,15 @@ class MetaRuleTests(BaseTestCase):
[RuleViolation("M1", "Author email for commit is invalid", email)])
def test_author_valid_email_rule_custom_regex(self):
+ # regex=None -> the rule isn't applied
+ rule = AuthorValidEmail()
+ rule.options['regex'].set(None)
+ emailadresses = [u"föo", None, u"hür dür"]
+ for email in emailadresses:
+ commit = self.gitcommit(u"", author_email=email)
+ violations = rule.validate(commit)
+ self.assertIsNone(violations)
+
# Custom domain
rule = AuthorValidEmail({'regex': u"[^@]+@bår.com"})
valid_email_addresses = [