diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2020-03-19 14:00:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2020-03-19 14:00:14 +0000 |
commit | df9615bac55ac6f1c3f516b66279ac0007175030 (patch) | |
tree | 84dd81d1c97835271cea7fbdd67c074742365e07 /gitlint/tests/rules/test_rules.py | |
parent | Initial commit. (diff) | |
download | gitlint-df9615bac55ac6f1c3f516b66279ac0007175030.tar.xz gitlint-df9615bac55ac6f1c3f516b66279ac0007175030.zip |
Adding upstream version 0.13.1.upstream/0.13.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'gitlint/tests/rules/test_rules.py')
-rw-r--r-- | gitlint/tests/rules/test_rules.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gitlint/tests/rules/test_rules.py b/gitlint/tests/rules/test_rules.py new file mode 100644 index 0000000..89caa27 --- /dev/null +++ b/gitlint/tests/rules/test_rules.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +from gitlint.tests.base import BaseTestCase +from gitlint.rules import Rule, RuleViolation + + +class RuleTests(BaseTestCase): + + def test_rule_equality(self): + self.assertEqual(Rule(), Rule()) + # Ensure rules are not equal if they differ on their attributes + for attr in ["id", "name", "target", "options"]: + rule = Rule() + setattr(rule, attr, u"åbc") + self.assertNotEqual(Rule(), rule) + + def test_rule_violation_equality(self): + violation1 = RuleViolation(u"ïd1", u"My messåge", u"My cöntent", 1) + self.object_equality_test(violation1, ["rule_id", "message", "content", "line_nr"]) |