diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-03-11 08:03:03 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-03-11 08:03:03 +0000 |
commit | de139943d8272773b5f19ed824d687b0232b9ba3 (patch) | |
tree | 47e73755bffd41bdde2d59d76cc595f5a1fa75d4 /gitlint-core/gitlint/tests/test_options.py | |
parent | Adding upstream version 0.19.0~dev. (diff) | |
download | gitlint-de139943d8272773b5f19ed824d687b0232b9ba3.tar.xz gitlint-de139943d8272773b5f19ed824d687b0232b9ba3.zip |
Adding upstream version 0.19.1.upstream/0.19.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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 |