summaryrefslogtreecommitdiffstats
path: root/test/rules/test_line_too_long.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/rules/test_line_too_long.py')
-rw-r--r--test/rules/test_line_too_long.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/rules/test_line_too_long.py b/test/rules/test_line_too_long.py
new file mode 100644
index 0000000..3c7517b
--- /dev/null
+++ b/test/rules/test_line_too_long.py
@@ -0,0 +1,20 @@
+"""Tests for line-too-long rule."""
+from ansiblelint.rules import RulesCollection
+from ansiblelint.rules.yaml_rule import YamllintRule
+from ansiblelint.testing import RunFromText
+
+LONG_LINE = """\
+---
+- name: Task example
+ debug:
+ msg: 'This is a very long text that is used in order to verify the rule that checks for very long lines. We do hope it was long enough to go over the line limit.'
+""" # noqa: E501
+
+
+def test_long_line() -> None:
+ """Negative test for long-line."""
+ collection = RulesCollection()
+ collection.register(YamllintRule())
+ runner = RunFromText(collection)
+ results = runner.run_role_tasks_main(LONG_LINE)
+ assert len(results) == 1