diff options
Diffstat (limited to 'gitlint-core/gitlint/tests/test_options.py')
-rw-r--r-- | gitlint-core/gitlint/tests/test_options.py | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/gitlint-core/gitlint/tests/test_options.py b/gitlint-core/gitlint/tests/test_options.py index 7b146e7..deff723 100644 --- a/gitlint-core/gitlint/tests/test_options.py +++ b/gitlint-core/gitlint/tests/test_options.py @@ -1,12 +1,23 @@ import os import re +from gitlint.options import ( + BoolOption, + IntOption, + ListOption, + PathOption, + RegexOption, + RuleOptionError, + StrOption, +) from gitlint.tests.base import BaseTestCase -from gitlint.options import IntOption, BoolOption, StrOption, ListOption, PathOption, RegexOption, RuleOptionError - class RuleOptionTests(BaseTestCase): + def test_option__str__(self): + option = StrOption("tëst-option", "åbc", "Test Dëscription") + self.assertEqual(str(option), "(tëst-option: åbc (Test Dëscription))") + def test_option_equality(self): options = { IntOption: 123, @@ -158,7 +169,7 @@ class RuleOptionTests(BaseTestCase): option = PathOption("tëst-directory", ".", "Tëst Description", type="dir") self.assertEqual(option.name, "tëst-directory") self.assertEqual(option.description, "Tëst Description") - self.assertEqual(option.value, os.getcwd()) + self.assertEqual(option.value, os.path.realpath(".")) self.assertEqual(option.type, "dir") # re-set value |