summaryrefslogtreecommitdiffstats
path: root/test/test_config.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 12:06:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 12:06:49 +0000
commit2fe34b6444502079dc0b84365ce82dbc92de308e (patch)
tree8fedcab52bbbc3db6c5aa909a88a7a7b81685018 /test/test_config.py
parentInitial commit. (diff)
downloadansible-lint-2fe34b6444502079dc0b84365ce82dbc92de308e.tar.xz
ansible-lint-2fe34b6444502079dc0b84365ce82dbc92de308e.zip
Adding upstream version 6.17.2.upstream/6.17.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/test_config.py')
-rw-r--r--test/test_config.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/test_config.py b/test/test_config.py
new file mode 100644
index 0000000..51a09b0
--- /dev/null
+++ b/test/test_config.py
@@ -0,0 +1,16 @@
+"""Tests for config module."""
+from ansiblelint.config import PROFILES
+from ansiblelint.rules import RulesCollection
+
+
+def test_profiles(default_rules_collection: RulesCollection) -> None:
+ """Test the rules included in profiles are valid."""
+ profile_banned_tags = {"opt-in", "experimental"}
+ for name, data in PROFILES.items():
+ for profile_rule_id in data["rules"]:
+ for rule in default_rules_collection.rules:
+ if profile_rule_id == rule.id:
+ forbidden_tags = profile_banned_tags & set(rule.tags)
+ assert (
+ not forbidden_tags
+ ), f"Rule {profile_rule_id} from {name} profile cannot use {profile_banned_tags & set(rule.tags)} tag."