summaryrefslogtreecommitdiffstats
path: root/test/test_requirements.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_requirements.py')
-rw-r--r--test/test_requirements.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/test_requirements.py b/test/test_requirements.py
new file mode 100644
index 0000000..0703d34
--- /dev/null
+++ b/test/test_requirements.py
@@ -0,0 +1,18 @@
+"""Tests requirements module."""
+
+from ansible_compat.runtime import Runtime
+
+from ansiblelint.requirements import Reqs
+
+
+def test_reqs() -> None:
+ """Performs basic testing of Reqs class."""
+ reqs = Reqs()
+ runtime = Runtime()
+ assert "ansible-core" in reqs
+ # checks that this ansible core version is not supported:
+ assert reqs.matches("ansible-core", "0.0") is False
+ # assert that invalid package name
+ assert reqs.matches("this-package-does-not-exist", "0.0") is False
+ # check the current ansible core version is supported:
+ assert reqs.matches("ansible-core", runtime.version)